1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/intl/tests/bug62017.phpt
2024-12-24 06:43:41 +00:00

27 lines
972 B
PHP

--TEST--
Bug #62017: datefmt_create with incorrectly encoded timezone leaks pattern
--EXTENSIONS--
intl
--FILE--
<?php
ini_set('intl.error_level', E_WARNING);
try {
datefmt_create('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "\xFF",
IntlDateFormatter::GREGORIAN, 'a');
} catch (IntlException $e) {
echo PHP_EOL."Exception: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . PHP_EOL;
}
try {
new IntlDateFormatter('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "Europe/Lisbon",
IntlDateFormatter::GREGORIAN, "\x80");
} catch (IntlException $e) {
echo PHP_EOL."Exception: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . PHP_EOL;
}
?>
--EXPECTF--
Exception: datefmt_create: Time zone identifier given is not a valid UTF-8 string in %s on line %d
Exception: IntlDateFormatter::__construct(): datefmt_create: error converting pattern to UTF-16 in %s on line %d