1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 08:28:26 +02:00
Files
archived-php-src/ext/gd/tests/imagegd_nullbyte_injection.phpt
T
Christoph M. Becker fc7b3cc7ca Fix nullbyte tests
As of PHP 8.0.0, failing ZPP throws instead of issuing warnings, to
which we have to cater to.
2019-06-12 12:48:03 +02:00

18 lines
379 B
PHP

--TEST--
Testing null byte injection in imagegd
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
?>
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
try {
imagegd($image, "./foo\0bar");
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
imagegd() expects parameter 2 to be a valid path, string given