mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
1018f462d8
Removed the corresponding core code. Fixed ext/com_dotnet and ext/date. Refactored ext/intl changes. Improved ext/fileinfo and ext/pdo changes. Fixed tests.
25 lines
912 B
PHP
25 lines
912 B
PHP
--TEST--
|
|
Bug #62017: datefmt_create with incorrectly encoded timezone leaks pattern
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('intl'))
|
|
die('skip intl extension not enabled');
|
|
--FILE--
|
|
<?php
|
|
ini_set('intl.error_level', E_WARNING);
|
|
var_dump(
|
|
datefmt_create('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "\xFF",
|
|
IntlDateFormatter::GREGORIAN, 'a'));
|
|
try {
|
|
var_dump(
|
|
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--
|
|
Warning: datefmt_create(): datefmt_create: Time zone identifier given is not a valid UTF-8 string in %s on line %d
|
|
NULL
|
|
|
|
Exception: IntlDateFormatter::__construct(): datefmt_create: error converting pattern to UTF-16 in %sbug62017.php on line %d
|