Skip to content

Commit

Permalink
false for lower branches.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Feb 5, 2025
1 parent 60a64dc commit 264d19b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3634,8 +3634,7 @@ PHP_FUNCTION(imagescale)
im = php_gd_libgdimageptr_from_zval_p(IM);

if (tmp_h < 0 && tmp_w < 0) {
zend_value_error("$width and $height cannot be both negative");
RETURN_THROWS();
RETURN_FALSE;
}

if (tmp_h < 0 || tmp_w < 0) {
Expand Down
8 changes: 2 additions & 6 deletions ext/gd/tests/gh17703.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ gd

$img = imagecreatetruecolor ( 256, 1);

try {
imagescale($img, -1, -1, 0);
} catch (\ValueError $e) {
echo $e->getMessage();
}
var_dump(imagescale($img, -1, -1, 0));
?>
--EXPECT--
$width and $height cannot be both negative
bool(false)

0 comments on commit 264d19b

Please sign in to comment.