xref: /PHP-5.5/ext/intl/tests/bug62017.phpt (revision 758f0686)
1--TEST--
2Bug #62017: datefmt_create with incorrectly encoded timezone leaks pattern
3--SKIPIF--
4<?php
5if (!extension_loaded('intl'))
6	die('skip intl extension not enabled');
7--FILE--
8<?php
9ini_set('intl.error_level', E_WARNING);
10var_dump(
11	datefmt_create('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "\xFF",
12		IntlDateFormatter::GREGORIAN, 'a'));
13var_dump(
14	new IntlDateFormatter('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "Europe/Lisbon",
15		IntlDateFormatter::GREGORIAN, "\x80"));
16--EXPECTF--
17Warning: datefmt_create(): datefmt_create: Time zone identifier given is not a valid UTF-8 string in %s on line %d
18NULL
19
20Warning: IntlDateFormatter::__construct(): datefmt_create: error converting pattern to UTF-16 in %s on line %d
21NULL
22
23