From 5af8361060550032e97b51e6a1c7004b2d60faa4 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 4 Sep 2019 01:10:56 +0200 Subject: [PATCH] Warnings to Errors: imagesetstyle --- ext/gd/gd.c | 4 ++-- ext/gd/tests/bug72709.phpt | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 027933ee64..b0215386d9 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -798,8 +798,8 @@ PHP_FUNCTION(imagesetstyle) num_styles = zend_hash_num_elements(Z_ARRVAL_P(styles)); if (num_styles == 0) { - php_error_docref(NULL, E_WARNING, "styles array must not be empty"); - RETURN_FALSE; + zend_throw_error(NULL, "Styles array must not be empty"); + return; } /* copy the style values in the stylearr */ diff --git a/ext/gd/tests/bug72709.phpt b/ext/gd/tests/bug72709.phpt index 1c5b1f4ae0..2963f1c104 100644 --- a/ext/gd/tests/bug72709.phpt +++ b/ext/gd/tests/bug72709.phpt @@ -7,12 +7,18 @@ if (!extension_loaded('gd')) die('skip ext/gd not available'); --FILE-- getMessage() . "\n"; +} + imagesetpixel($im, 0, 0, IMG_COLOR_STYLED); imagedestroy($im); ?> ====DONE==== ---EXPECTF-- -Warning: imagesetstyle(): styles array must not be empty in %s%ebug72709.php on line %d -bool(false) +--EXPECT-- +Styles array must not be empty ====DONE==== -- 2.50.0