From 8ade502b4eb556ae6ec8c3515371c2a541a9863e Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Thu, 8 Aug 2024 15:19:31 +0200 Subject: [PATCH 1/3] fix: more deprecation warnings on image uploads --- endpoints/payments/add.php | 8 ++++---- endpoints/subscription/add.php | 8 ++++---- endpoints/user/save_user.php | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/endpoints/payments/add.php b/endpoints/payments/add.php index 6a674ac31..93ebf021d 100644 --- a/endpoints/payments/add.php +++ b/endpoints/payments/add.php @@ -115,13 +115,13 @@ function resizeAndUploadLogo($uploadedFile, $uploadDir, $name) $newHeight = $height; if ($width > $targetWidth) { - $newWidth = $targetWidth; - $newHeight = ($targetWidth / $width) * $height; + $newWidth = (int)$targetWidth; + $newHeight = (int)(($targetWidth / $width) * $height); } if ($newHeight > $targetHeight) { - $newWidth = ($targetHeight / $newHeight) * $newWidth; - $newHeight = $targetHeight; + $newWidth = (int)(($targetHeight / $newHeight) * $newWidth); + $newHeight = (int)$targetHeight; } $resizedImage = imagecreatetruecolor($newWidth, $newHeight); diff --git a/endpoints/subscription/add.php b/endpoints/subscription/add.php index b25d0a655..060cafc6e 100644 --- a/endpoints/subscription/add.php +++ b/endpoints/subscription/add.php @@ -116,13 +116,13 @@ function resizeAndUploadLogo($uploadedFile, $uploadDir, $name, $settings) $newHeight = $height; if ($width > $targetWidth) { - $newWidth = $targetWidth; - $newHeight = ($targetWidth / $width) * $height; + $newWidth = (int)$targetWidth; + $newHeight = (int)(($targetWidth / $width) * $height); } if ($newHeight > $targetHeight) { - $newWidth = ($targetHeight / $newHeight) * $newWidth; - $newHeight = $targetHeight; + $newWidth = (int)(($targetHeight / $newHeight) * $newWidth); + $newHeight = (int)$targetHeight; } $resizedImage = imagecreatetruecolor($newWidth, $newHeight); diff --git a/endpoints/user/save_user.php b/endpoints/user/save_user.php index 0cf574ae9..0931a9510 100644 --- a/endpoints/user/save_user.php +++ b/endpoints/user/save_user.php @@ -153,13 +153,13 @@ function resizeAndUploadAvatar($uploadedFile, $uploadDir, $name) $newHeight = $height; if ($width > $targetWidth) { - $newWidth = $targetWidth; - $newHeight = ($targetWidth / $width) * $height; + $newWidth = (int)$targetWidth; + $newHeight = (int)(($targetWidth / $width) * $height); } if ($newHeight > $targetHeight) { - $newWidth = ($targetHeight / $newHeight) * $newWidth; - $newHeight = $targetHeight; + $newWidth = (int)(($targetHeight / $newHeight) * $newWidth); + $newHeight = (int)$targetHeight; } $resizedImage = imagecreatetruecolor($newWidth, $newHeight); From e6ad2b5bd51141ac8ceb842f951473345c699c81 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Thu, 8 Aug 2024 22:04:05 +0200 Subject: [PATCH 2/3] fix: broken avatar upload when using the french language --- settings.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/settings.php b/settings.php index 144670adf..a27c9082d 100644 --- a/settings.php +++ b/settings.php @@ -53,7 +53,7 @@ class="avatar-option" data-src="images/uploads/logos/avatars/" /> + onChange="successfulUpload(this, '')" />
@@ -1231,13 +1231,6 @@ class="thin">
-
-
- > - -
-
From f69613f0dfc2b9cc85ee598f57beb44529a36155 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Thu, 8 Aug 2024 22:05:47 +0200 Subject: [PATCH 3/3] bump version --- includes/version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/version.php b/includes/version.php index 7ba82494d..3dadda18d 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ \ No newline at end of file