From 264d19baa791e0867823f897aaa01e72d8c34dd2 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 5 Feb 2025 18:05:24 +0000 Subject: [PATCH] false for lower branches. --- ext/gd/gd.c | 3 +-- ext/gd/tests/gh17703.phpt | 8 ++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 48e031ddec02..2506a33fe7c7 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -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) { diff --git a/ext/gd/tests/gh17703.phpt b/ext/gd/tests/gh17703.phpt index 39cc9a9d5552..512ced92cf47 100644 --- a/ext/gd/tests/gh17703.phpt +++ b/ext/gd/tests/gh17703.phpt @@ -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)