com php-src: Merge branch 'PHP-7.4': ext/gd/tests/imagegd2_ nullbyte_injection.phpt ext/gd/tests/imagegd_nullbyte _injection.phpt

From: Date: Wed, 12 Jun 2019 05:58:56 +0000
Subject: com php-src: Merge branch 'PHP-7.4': ext/gd/tests/imagegd2_ nullbyte_injection.phpt ext/gd/tests/imagegd_nullbyte _injection.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106689@lists.php.net to get a copy of this message
Commit: 74a82ca91c7a34912c17737e3ba2900f550f7724 Author: Joe Watkins <krakjoe@php.net> Wed, 12 Jun 2019 07:55:21 +0200 Parents: 12f1ab02eb48c1857b5d1e5d59daa5bcb30ef343 2dfa49531170e55d9a9bf4933bc3d60ee05c157f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=74a82ca91c7a34912c17737e3ba2900f550f7724 Log: Merge branch 'PHP-7.4' * PHP-7.4: fix flaky gd tests Changed paths: MM ext/gd/tests/imagegd2_nullbyte_injection.phpt MM ext/gd/tests/imagegd_nullbyte_injection.phpt Diff: diff --cc ext/gd/tests/imagegd2_nullbyte_injection.phpt index 5eae5c7,4307704..537535b --- a/ext/gd/tests/imagegd2_nullbyte_injection.phpt +++ b/ext/gd/tests/imagegd2_nullbyte_injection.phpt @@@ -22,16 -21,12 +21,16 @@@ $userinput = "1\0"; // from post or ge $temp = $tempdir. "/test" . $userinput .".tmp"; echo "\nimagegd2 TEST\n"; -imagegd2($image, $temp); +try { + imagegd2($image, $temp); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(file_exists($tempdir. "/test1")); var_dump(file_exists($tempdir. "/test1.tmp")); - foreach (glob($tempdir . "/test*") as $file ) { unlink($file); } ---EXPECTF-- ++?> +--EXPECT-- imagegd2 TEST - -Warning: imagegd2() expects parameter 2 to be a valid path, string given in %s on line %d +imagegd2() expects parameter 2 to be a valid path, string given bool(false) bool(false) diff --cc ext/gd/tests/imagegd_nullbyte_injection.phpt index 235bd46,f904bbf..dbfff3b --- a/ext/gd/tests/imagegd_nullbyte_injection.phpt +++ b/ext/gd/tests/imagegd_nullbyte_injection.phpt @@@ -22,16 -21,13 +21,16 @@@ $userinput = "1\0"; // from post or ge $temp = $tempdir. "/test" . $userinput .".tmp"; echo "\nimagegd TEST\n"; -imagegd($image, $temp); +try { + imagegd($image, $temp); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(file_exists($tempdir. "/test1")); var_dump(file_exists($tempdir. "/test1.tmp")); - foreach (glob($tempdir . "/test*") as $file ) { unlink($file); } + ?> ---EXPECTF-- +--EXPECT-- imagegd TEST - -Warning: imagegd() expects parameter 2 to be a valid path, string given in %s on line %d +imagegd() expects parameter 2 to be a valid path, string given bool(false) bool(false)

« previous php.cvs (#106689) next »