From: Antony Dovgal Date: Tue, 22 May 2007 10:22:49 +0000 (+0000) Subject: MFH: fix #41442 (imagegd2() under output control) X-Git-Tag: php-5.2.3RC1~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=083844f847fc3030189d97ad51e9c9d843bcf5c6;p=php MFH: fix #41442 (imagegd2() under output control) --- diff --git a/NEWS b/NEWS index b4ac49a8ce..7fb9a4c214 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,7 @@ PHP NEWS - Fixed segfault in strripos(). (Tony, Joxean Koret) - Fixed bug #41455 (ext/dba/config.m4 pollutes global $LIBS and $LDFLAGS). (mmarek at suse dot cz, Tony) +- Fixed bug #41442 (imagegd2() under output control). (Tony) - Fixed bug #41430 (Fatal error with negative values of maxlen parameter of file_get_contents()). (Tony) - fixed bug #41423 (PHP assumes wrongly that certain ciphers are enabled in diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 71bd7b966a..3340df0847 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -2825,6 +2825,14 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char } (*func_p)(im, fp); break; +#endif +#ifdef HAVE_GD_GD2 + case PHP_GDIMG_TYPE_GD2: + if (q == -1) { + q = 128; + } + (*func_p)(im, fp, q, t); + break; #endif default: if (q == -1) { @@ -2877,6 +2885,14 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char } (*func_p)(im, tmp); break; +#endif +#ifdef HAVE_GD_GD2 + case PHP_GDIMG_TYPE_GD2: + if (q == -1) { + q = 128; + } + (*func_p)(im, tmp, q, t); + break; #endif default: (*func_p)(im, tmp); diff --git a/ext/gd/tests/bug41442.phpt b/ext/gd/tests/bug41442.phpt new file mode 100644 index 0000000000..78a61bec95 --- /dev/null +++ b/ext/gd/tests/bug41442.phpt @@ -0,0 +1,37 @@ +--TEST-- +Bug #41442 (imagegd2() under output control) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +resource(%d) of type (gd) +resource(%d) of type (gd) +Done