mirror of
https://github.com/php/php-src.git
synced 2024-10-02 07:16:11 +00:00
e08566c613
IntlDateFormatter constructor would release some resources under certain error conditions.
23 lines
736 B
PHP
23 lines
736 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'));
|
|
var_dump(
|
|
new IntlDateFormatter('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "Europe/Lisbon",
|
|
IntlDateFormatter::GREGORIAN, "\x80"));
|
|
--EXPECTF--
|
|
Warning: datefmt_create(): datefmt_create: error converting timezone_str to UTF-16 in %s on line %d
|
|
NULL
|
|
|
|
Warning: IntlDateFormatter::__construct(): datefmt_create: error converting pattern to UTF-16 in %s on line %d
|
|
NULL
|
|
|