Skip to content

Commit

Permalink
2 21 3 (#484)
Browse files Browse the repository at this point in the history
fix: more deprecation warnings on image uploads
fix: broken avatar upload when using the french language
  • Loading branch information
ellite authored Aug 8, 2024
1 parent b97782f commit 082e80c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
8 changes: 4 additions & 4 deletions endpoints/payments/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions endpoints/subscription/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions endpoints/user/save_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion includes/version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
$version = "v2.21.2";
$version = "v2.21.3";
?>
9 changes: 1 addition & 8 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class="avatar-option" data-src="images/uploads/logos/avatars/<?= $image ?>" />
</div>
<input type="file" id="profile_pic" class="hidden-input" name="profile_pic"
accept="image/jpeg, image/png, image/gif, image/webp"
onChange="successfulUpload(this, '<?= translate('file_type_error', $i18n) ?>')" />
onChange="successfulUpload(this, '<?= addslashes(translate('file_type_error', $i18n)) ?>')" />
</div>
</div>
<div class="grow">
Expand Down Expand Up @@ -1231,13 +1231,6 @@ class="thin"><?= $settings['customCss'] ?? "" ?></textarea>
<label for="hidedisabled"><?= translate('hide_disabled_subscriptions', $i18n) ?></label>
</div>
</div>
<div>
<div class="form-group-inline">
<input type="checkbox" id="disabledtobottom" name="disabledtobottom" onChange="setDisabledToBottom()" <?php if ($settings['disabled_to_bottom'])
echo 'checked'; ?>>
<label for="disabledtobottom"><?= translate('show_disabled_subscriptions_at_the_bottom', $i18n) ?></label>
</div>
</div>
</div>
</section>

Expand Down

0 comments on commit 082e80c

Please sign in to comment.