[php-src] PHP-8.6: Merge branch 'PHP-8.5' into PHP-8.6

From: Date: Mon, 02 Nov 2026 15:40:19 +0000
Subject: [php-src] PHP-8.6: Merge branch 'PHP-8.5' into PHP-8.6
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-143224@lists.php.net to get a copy of this message
Author: Arnaud Le Blanc (arnaud-lb) Date: 2026-11-02T16:39:49+01:00 Commit: https://github.com/php/php-src/commit/57978902becd3995db1acba0e9e3f825d0b4f2e3 Raw diff: https://github.com/php/php-src/commit/57978902becd3995db1acba0e9e3f825d0b4f2e3.diff Merge branch 'PHP-8.5' into PHP-8.6 * PHP-8.5: Fix imagetruecolortopalette() error message for $num_colors (#24780) Changed paths: M NEWS M ext/gd/gd.c M ext/gd/tests/bug72697.phpt M ext/gd/tests/imagetruecolortopalette_error3.phpt M ext/gd/tests/imagetruecolortopalette_error4.phpt Diff: diff --git a/NEWS b/NEWS index 49e7f68744e0..9fb2c3cb0153 100644 --- a/NEWS +++ b/NEWS @@ -65,6 +65,9 @@ PHP NEWS . Fixed null pointer dereference in fpm_get_status() when the scoreboard copy fails. (Marcel Hernandez) +- GD: + . Fixed imagetruecolortopalette() error message. (Marc Bennewitz) + - Hash: . Fix GOST and Snefru digests of 512 MiB or more. (Martin Mirchev) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 8d65d12aef65..527ef8968d70 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -727,7 +727,7 @@ PHP_FUNCTION(imagetruecolortopalette) im = php_gd_libgdimageptr_from_zval_p(IM); if (ncolors <= 0 || ZEND_LONG_INT_OVFL(ncolors)) { - zend_argument_value_error(3, "must be greater than 0 and less than %d", INT_MAX); + zend_argument_value_error(3, "must be between 1 and %d", INT_MAX); RETURN_THROWS(); } diff --git a/ext/gd/tests/bug72697.phpt b/ext/gd/tests/bug72697.phpt index a7ab6114db34..f8c21406ba05 100644 --- a/ext/gd/tests/bug72697.phpt +++ b/ext/gd/tests/bug72697.phpt @@ -20,5 +20,5 @@ trycatch_dump( ?> DONE --EXPECT-- -!! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be greater than 0 and less than 2147483647 +!! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be between 1 and 2147483647 DONE diff --git a/ext/gd/tests/imagetruecolortopalette_error3.phpt b/ext/gd/tests/imagetruecolortopalette_error3.phpt index 0cbeca7e6d8b..d7726562572c 100644 --- a/ext/gd/tests/imagetruecolortopalette_error3.phpt +++ b/ext/gd/tests/imagetruecolortopalette_error3.phpt @@ -20,4 +20,4 @@ trycatch_dump( ?> --EXPECT-- -!! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be greater than 0 and less than 2147483647 +!! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be between 1 and 2147483647 diff --git a/ext/gd/tests/imagetruecolortopalette_error4.phpt b/ext/gd/tests/imagetruecolortopalette_error4.phpt index d1e8cffc39d3..36b6d91b854b 100644 --- a/ext/gd/tests/imagetruecolortopalette_error4.phpt +++ b/ext/gd/tests/imagetruecolortopalette_error4.phpt @@ -21,5 +21,5 @@ trycatch_dump( ?> --EXPECT-- -!! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be greater than 0 and less than 2147483647 -!! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be greater than 0 and less than 2147483647 +!! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be between 1 and 2147483647 +!! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be between 1 and 2147483647

« previous php.cvs (#143224) next »