mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Add test case for GH-13774
This commit is contained in:
25
ext/gd/tests/gh13774.phpt
Normal file
25
ext/gd/tests/gh13774.phpt
Normal file
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
GH-13774 (Restore Warning instead of Fatal Error in gd_webp.c)
|
||||
--EXTENSIONS--
|
||||
gd
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['WebP Support']) || $support['WebP Support'] === false) {
|
||||
print 'skip webp support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$empty_webp = __DIR__ . "/gh13774.webp";
|
||||
file_put_contents($empty_webp, "");
|
||||
$im = imagecreatefromwebp($empty_webp);
|
||||
var_dump($im);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php unlink(__DIR__ . "/gh13774.webp")?>
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromwebp(): gd-webp cannot get webp info in %s on line %d
|
||||
|
||||
Warning: imagecreatefromwebp(): "%s" is not a valid WEBP file in %s on line %d
|
||||
bool(false)
|
||||
Reference in New Issue
Block a user