Skip to content

Commit 6188734

Browse files
authored
Merge pull request #16964 from phpbg/master
Fix sanity checks #16963
2 parents d22ab5e + 94eb77a commit 6188734

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/private/legacy/image.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -878,10 +878,8 @@ public function preciseResize(int $width, int $height): bool {
878878
$widthOrig = imagesx($this->resource);
879879
$heightOrig = imagesy($this->resource);
880880
$process = imagecreatetruecolor($width, $height);
881-
882-
if ($process == false) {
881+
if ($process === false) {
883882
$this->logger->error(__METHOD__ . '(): Error creating true color image', array('app' => 'core'));
884-
imagedestroy($process);
885883
return false;
886884
}
887885

@@ -892,8 +890,8 @@ public function preciseResize(int $width, int $height): bool {
892890
imagesavealpha($process, true);
893891
}
894892

895-
imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig);
896-
if ($process == false) {
893+
$res = imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig);
894+
if ($res === false) {
897895
$this->logger->error(__METHOD__ . '(): Error re-sampling process image', array('app' => 'core'));
898896
imagedestroy($process);
899897
return false;

0 commit comments

Comments
 (0)