1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/ext/date/tests/DateTimeZone_serialize_errors.phpt
2022-04-29 09:44:27 +01:00

16 lines
451 B
PHP

--TEST--
Test unserialization of DateTimeZone with null byte
--FILE--
<?php
$serialized = 'O:12:"DateTimeZone":2:{s:13:"timezone_type";i:3;s:8:"timezone";s:17:"Ame' . "\0" .'rica/New_York";}';
try {
$tz = unserialize($serialized);
} catch (Throwable $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: DateTimeZone::__unserialize(): Timezone must not contain null bytes in %s on line %d
Invalid serialization data for DateTimeZone object