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); 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 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/= $image ?>" /> + onChange="successfulUpload(this, '= addslashes(translate('file_type_error', $i18n)) ?>')" />