php-src/ext/gd/tests/gdimage_prevent_serialization.phpt
Christoph M. Becker a375d54785
Migrate skip checks to --EXTENSIONS-- for ext/gd
Cf. PR #6787.

Closes GH-6994.
2021-05-22 15:38:51 +02:00

18 lines
351 B
PHP

--TEST--
GdImage instances must not be serialized
--EXTENSIONS--
gd
--FILE--
<?php
$img_src = imagecreatetruecolor(32, 32);
var_dump(serialize($img_src));
?>
--EXPECTF--
Fatal error: Uncaught Exception: Serialization of 'GdImage' is not allowed in %s:%d
Stack trace:
#0 %s(%d): serialize(Object(GdImage))
#1 {main}
thrown in %s on line %d