Skip to content

Commit a6d1844

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Add test case for GH-13774
2 parents 780a828 + 0ed956d commit a6d1844

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

ext/gd/tests/gh13774.phpt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
GH-13774 (Restore Warning instead of Fatal Error in gd_webp.c)
3+
--EXTENSIONS--
4+
gd
5+
--SKIPIF--
6+
<?php
7+
$support = gd_info();
8+
if (!isset($support['WebP Support']) || $support['WebP Support'] === false) {
9+
print 'skip webp support not available';
10+
}
11+
?>
12+
--FILE--
13+
<?php
14+
$empty_webp = __DIR__ . "/gh13774.webp";
15+
file_put_contents($empty_webp, "");
16+
$im = imagecreatefromwebp($empty_webp);
17+
var_dump($im);
18+
?>
19+
--CLEAN--
20+
<?php unlink(__DIR__ . "/gh13774.webp")?>
21+
--EXPECTF--
22+
Warning: imagecreatefromwebp(): gd-webp cannot get webp info in %s on line %d
23+
24+
Warning: imagecreatefromwebp(): "%s" is not a valid WEBP file in %s on line %d
25+
bool(false)

0 commit comments

Comments
 (0)