diff options
127 files changed, 3612 insertions, 1627 deletions
diff --git a/.gitignore b/.gitignore index 8d0e7565f2..f696b15ebf 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ *.tgz *.tar.gz *.tar.bz2 +*.tar.xz .FBCIndex .FBCLockFolder .deps diff --git a/.travis.yml b/.travis.yml index b2ed607cac..31cdcd07f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,4 +39,4 @@ before_script: - . ./travis/ext/pdo_pgsql/setup.sh # Run PHPs run-tests.php -script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120 +script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120 -s diff --git a/EXTENSIONS b/EXTENSIONS index 61a1688b3c..fd454dfc54 100644 --- a/EXTENSIONS +++ b/EXTENSIONS @@ -385,6 +385,12 @@ MAINTENANCE: Maintained STATUS: Working SINCE: 4.0.4 ------------------------------------------------------------------------------- +EXTENSION: hash +PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net> +MAINTENANCE: Maintained +STATUS: Working +SINCE: 5.1.2 +------------------------------------------------------------------------------- EXTENSION: iconv PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net> MAINTENANCE: Maintained @@ -438,6 +444,12 @@ PRIMARY MAINTAINER: Frank M. Kromann MAINTENANCE: Unknown STATUS: Experimental ------------------------------------------------------------------------------- +EXTENSION: opcache +PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>, Xinchen Hui <laruence@php.net> +MAINTENANCE: Maintained +STATUS: Working +SINCE: 5.5.0 +------------------------------------------------------------------------------- EXTENSION: openssl PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net> MAINTENANCE: Maintained @@ -1,6 +1,85 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? 2014, PHP 5.5.18 +?? ??? 2014, PHP 5.5.20 + +- Core: + . Fixed bug #68091 (Some Zend headers lack appropriate extern "C" blocks). + (Adam) + . Fixed bug #68185 ("Inconsistent insteadof definition."- incorrectly + triggered). (Julien) + . Fixed bug #68370 ("unset($this)" can make the program crash). (Laruence) + +- FPM: + . Fixed bug #68381 (fpm_unix_init_main ignores log_level). + (David Zuelke, Remi) + . Fixed bug #68420 (listen=9000 listens to ipv6 localhost instead of all + addresses). (Remi) + . Fixed bug #68421 (access.format='%R' doesn't log ipv6 address). (Remi) + . Fixed bug #68423 (PHP-FPM will no longer load all pools). (Remi) + . Fixed bug #68428 (listen.allowed_clients is IPv4 only). (Remi) + . Fixed bug #68452 (php-fpm man page is oudated). (Remi) + . Fixed request #68458 (Change pm.start_servers default warning to + notice). (David Zuelke, Remi) + . Fixed bug #68463 (listen.allowed_clients can silently result + in no allowed access). (Remi) + . Fixed request #68391 (php-fpm conf files loading order). + (Florian Margaine, Remi) + . Fixed bug #68478 (access.log don't use prefix). (Remi) + +- PDO_pgsql: + . Fixed bug #66584 (Segmentation fault on statement deallocation) (Matteo) + . Fixed bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception + when not in transaction) (Matteo) + . Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving) + (Matteo) + +- zlib: + . Fixed bug #53829 (Compiling PHP with large file support will replace + function gzopen by gzopen64) (Sascha Kettler, Matteo) + +13 Nov 2014, PHP 5.5.19 + +- Core: + . Fixed bug #68095 (AddressSanitizer reports a heap buffer overflow in + php_getopt()). (Stas) + . Fixed bug #68118 ($a->foo .= 'test'; can leave $a->foo undefined). (Nikita) + . Fixed bug #68129 (parse_url() - incomplete support for empty usernames + and passwords) (Tjerk) + . Fixed bug #68365 (zend_mm_heap corrupted after memory overflow in + zend_hash_copy). (Dmitry) + +- CURL: + . Add CURL_SSLVERSION_TLSv1_0, CURL_SSLVERSION_TLSv1_1, and + CURL_SSLVERSION_TLSv1_2 constants if supported by libcurl (Rasmus) + +- Fileinfo: + . Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB) + . Fixed bug #68283 (fileinfo: out-of-bounds read in elf note headers). + (CVE-2014-3710) (Remi) + +- GD: + . Fixed bug #65171 (imagescale() fails without height param). (Remi) + +- GMP: + . Fixed bug #63595 (GMP memory management conflicts with other libraries + using GMP). (Remi) + +- Mysqli: + . Fixed bug #68114 (linker error on some OS X machines with fixed width + decimal support) (Keyur Govande) + +- ODBC: + . Fixed bug #68087 (ODBC not correctly reading DATE column when preceded by + a VARCHAR column) (Keyur Govande) + +- SOAP: + . Fixed bug #68361 (Segmentation fault on SoapClient::__getTypes). + (Laruence) + +- SPL: + . Fixed bug #68128 (Regression in RecursiveRegexIterator) (Tjerk) + +16 Oct 2014, PHP 5.5.18 - Core: . Fixed bug #67985 (Incorrect last used array index copied to new array after @@ -14,6 +93,8 @@ PHP NEWS - FPM: . Fixed bug #65641 (PHP-FPM incorrectly defines the SCRIPT_NAME variable when using Apache, mod_proxy-fcgi and ProxyPass). (Remi) + . Implemented FR #55508 (listen and listen.allowed_clients should take IPv6 + addresses). (Robin Gloster) - Reflection: . Fixed bug #68103 (Duplicate entry in Reflection for class alias). (Remi) diff --git a/Zend/tests/bug68118.phpt b/Zend/tests/bug68118.phpt new file mode 100644 index 0000000000..c56e70a112 --- /dev/null +++ b/Zend/tests/bug68118.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #68118: $a->foo .= 'test'; can leave $a->foo undefined +--FILE-- +<?php + +set_error_handler(function() { + $obj = new stdClass; + $obj->test = 'meow'; + return true; +}); + +$a = new stdClass; +$a->undefined .= 'test'; +var_dump($a); + +?> +--EXPECT-- +object(stdClass)#2 (1) { + ["undefined"]=> + string(4) "test" +} diff --git a/Zend/tests/bug68370.phpt b/Zend/tests/bug68370.phpt new file mode 100644 index 0000000000..25589bf455 --- /dev/null +++ b/Zend/tests/bug68370.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #68370 "unset($this)" can make the program crash +--FILE-- +<?php +class C { + public function test() { + unset($this); + return get_defined_vars(); + } +} +$c = new C(); +$x = $c->test(); +print_r($x); +unset($c, $x); +--EXPECTF-- +Array +( +) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index bd3e1dd813..6e1912803e 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -4116,7 +4116,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* /* make sure that the trait method is not from a class mentioned in exclude_from_classes, for consistency */ - if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i]) { + if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[j]) { zend_error(E_COMPILE_ERROR, "Inconsistent insteadof definition. " "The method %s is to be used from %s, but %s is also on the exclude list", diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 7e2a3378da..f5ee01463a 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1341,6 +1341,10 @@ ZEND_API void zend_timeout(int dummy) /* {{{ */ #ifdef ZEND_WIN32 static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* {{{ */ { +#ifdef ZTS + THREAD_T thread_id = (THREAD_T)wParam; +#endif + switch (message) { case WM_DESTROY: PostQuitMessage(0); @@ -1355,7 +1359,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa #endif SetTimer(timeout_window, wParam, lParam*1000, NULL); #ifdef ZTS - tsrm_ls = ts_resource_ex(0, &wParam); + tsrm_ls = ts_resource_ex(0, &thread_id); if (!tsrm_ls) { /* shouldn't normally happen */ break; @@ -1372,7 +1376,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa #ifdef ZTS void ***tsrm_ls; - tsrm_ls = ts_resource_ex(0, &wParam); + tsrm_ls = ts_resource_ex(0, &thread_id); if (!tsrm_ls) { /* Thread died before receiving its timeout? */ break; @@ -1761,13 +1765,6 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */ /*printf("Cache miss! Initialized %x\n", EG(active_symbol_table));*/ } ex->symbol_table = EG(active_symbol_table); - - if (ex->op_array->this_var != -1 && - !*EX_CV_NUM(ex, ex->op_array->this_var) && - EG(This)) { - *EX_CV_NUM(ex, ex->op_array->this_var) = (zval**)EX_CV_NUM(ex, ex->op_array->last_var + ex->op_array->this_var); - **EX_CV_NUM(ex, ex->op_array->this_var) = EG(This); - } for (i = 0; i < ex->op_array->last_var; i++) { if (*EX_CV_NUM(ex, i)) { zend_hash_quick_update(EG(active_symbol_table), diff --git a/Zend/zend_float.h b/Zend/zend_float.h index 33f8e93fbf..d9e4f4be88 100644 --- a/Zend/zend_float.h +++ b/Zend/zend_float.h @@ -21,6 +21,8 @@ #ifndef ZEND_FLOAT_H #define ZEND_FLOAT_H +BEGIN_EXTERN_C() + /* Define functions for FP initialization and de-initialization. */ @@ -28,6 +30,8 @@ extern ZEND_API void zend_init_fpu(TSRMLS_D); extern ZEND_API void zend_shutdown_fpu(TSRMLS_D); extern ZEND_API void zend_ensure_fpu_mode(TSRMLS_D); +END_EXTERN_C() + /* Copy of the contents of xpfpa.h (which is under public domain) See http://wiki.php.net/rfc/rounding for details. diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 093951eeca..a7b761fa38 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -754,9 +754,6 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type /* we don't have access controls - will just add it */ new_zval = &EG(uninitialized_zval); - if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) { - zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member)); - } Z_ADDREF_P(new_zval); if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && property_info->offset >= 0) { @@ -776,6 +773,12 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type } zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval); } + + /* Notice is thrown after creation of the property, to avoid EG(std_property_info) + * being overwritten in an error handler. */ + if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) { + zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member)); + } } else { /* we do have getter - fail and let it try again with usual get/set */ retval = NULL; diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index 9674de5246..cc73c379a7 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -135,9 +135,9 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC) } ALLOC_HASHTABLE_REL(tmp_ht); zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0); + zvalue->value.ht = tmp_ht; zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); tmp_ht->nNextFreeElement = original_ht->nNextFreeElement; - zvalue->value.ht = tmp_ht; } break; case IS_OBJECT: diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h index 078be15b74..e403e7cc92 100644 --- a/Zend/zend_vm.h +++ b/Zend/zend_vm.h @@ -21,9 +21,13 @@ #ifndef ZEND_VM_H #define ZEND_VM_H +BEGIN_EXTERN_C() + ZEND_API void zend_vm_use_old_executor(void); ZEND_API void zend_vm_set_opcode_handler(zend_op* opcode); +END_EXTERN_C() + #define ZEND_VM_SET_OPCODE_HANDLER(opline) zend_vm_set_opcode_handler(opline) #endif diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 08657e5f31..41febfa44d 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -1181,7 +1181,9 @@ function gen_vm($def, $skel) { out($f, $GLOBALS['header_text']); fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n"); + fputs($f, "BEGIN_EXTERN_C()\n\n"); fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n"); + fputs($f, "END_EXTERN_C()\n\n"); foreach ($opcodes as $code => $dsc) { $code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT); diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index 4ed726d217..89a1afad49 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -21,8 +21,12 @@ #ifndef ZEND_VM_OPCODES_H #define ZEND_VM_OPCODES_H +BEGIN_EXTERN_C() + ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); +END_EXTERN_C() + #define ZEND_NOP 0 #define ZEND_ADD 1 #define ZEND_SUB 2 diff --git a/configure.in b/configure.in index 92b49006e6..b16a97e72c 100644 --- a/configure.in +++ b/configure.in @@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...); PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=5 -PHP_RELEASE_VERSION=18 +PHP_RELEASE_VERSION=20 PHP_EXTRA_VERSION="-dev" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 765918cc35..43af68e817 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -169,6 +169,11 @@ static int php_curl_option_str(php_curl *ch, long option, const char *str, const { CURLcode error = CURLE_OK; + if (strlen(str) != len) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)"); + return FAILURE; + } + #if LIBCURL_VERSION_NUM >= 0x071100 if (make_copy) { #endif @@ -1197,6 +1202,12 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLSSLOPT_ALLOW_BEAST); #endif +#if LIBCURL_VERSION_NUM >= 0x072200 /* Available since 7.34.0 */ + REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_0); + REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_1); + REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_2); +#endif + #if CURLOPT_FTPASCII != 0 REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII); #endif diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt new file mode 100644 index 0000000000..d65441b2cc --- /dev/null +++ b/ext/curl/tests/bug68089.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #68089 (NULL byte injection - cURL lib) +--SKIPIF-- +<?php +include 'skipif.inc'; + +?> +--FILE-- +<?php +$url = "file:///etc/passwd\0http://google.com"; +$ch = curl_init(); +var_dump(curl_setopt($ch, CURLOPT_URL, $url)); +?> +Done +--EXPECTF-- +Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s%ebug68089.php on line 4 +bool(false) +Done diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 98e7b2292c..157f0f4941 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -1,589 +1,590 @@ -const timelib_tzdb_index_entry timezonedb_idx_builtin[582] = { +const timelib_tzdb_index_entry timezonedb_idx_builtin[583] = { { "Africa/Abidjan" , 0x000000 }, { "Africa/Accra" , 0x000055 }, { "Africa/Addis_Ababa" , 0x00019D }, - { "Africa/Algiers" , 0x0001F3 }, - { "Africa/Asmara" , 0x00031E }, - { "Africa/Asmera" , 0x000374 }, - { "Africa/Bamako" , 0x0003CA }, - { "Africa/Bangui" , 0x00041F }, - { "Africa/Banjul" , 0x000474 }, - { "Africa/Bissau" , 0x0004C9 }, - { "Africa/Blantyre" , 0x00052F }, - { "Africa/Brazzaville" , 0x000584 }, - { "Africa/Bujumbura" , 0x0005D9 }, - { "Africa/Cairo" , 0x00062E }, - { "Africa/Casablanca" , 0x000A15 }, - { "Africa/Ceuta" , 0x000C77 }, - { "Africa/Conakry" , 0x000F7E }, - { "Africa/Dakar" , 0x000FD3 }, - { "Africa/Dar_es_Salaam" , 0x001028 }, - { "Africa/Djibouti" , 0x001095 }, - { "Africa/Douala" , 0x0010EA }, - { "Africa/El_Aaiun" , 0x00113F }, - { "Africa/Freetown" , 0x00136A }, - { "Africa/Gaborone" , 0x0013BF }, - { "Africa/Harare" , 0x001414 }, - { "Africa/Johannesburg" , 0x001469 }, - { "Africa/Juba" , 0x0014D7 }, - { "Africa/Kampala" , 0x0015EA }, - { "Africa/Khartoum" , 0x001669 }, - { "Africa/Kigali" , 0x00177C }, - { "Africa/Kinshasa" , 0x0017D1 }, - { "Africa/Lagos" , 0x00183D }, - { "Africa/Libreville" , 0x001892 }, - { "Africa/Lome" , 0x0018E7 }, - { "Africa/Luanda" , 0x00193C }, - { "Africa/Lubumbashi" , 0x001991 }, - { "Africa/Lusaka" , 0x0019FD }, - { "Africa/Malabo" , 0x001A52 }, - { "Africa/Maputo" , 0x001AA7 }, - { "Africa/Maseru" , 0x001AFC }, - { "Africa/Mbabane" , 0x001B6A }, - { "Africa/Mogadishu" , 0x001BD8 }, - { "Africa/Monrovia" , 0x001C33 }, - { "Africa/Nairobi" , 0x001C99 }, - { "Africa/Ndjamena" , 0x001D18 }, - { "Africa/Niamey" , 0x001D84 }, - { "Africa/Nouakchott" , 0x001DD9 }, - { "Africa/Ouagadougou" , 0x001E2E }, - { "Africa/Porto-Novo" , 0x001E83 }, - { "Africa/Sao_Tome" , 0x001ED8 }, - { "Africa/Timbuktu" , 0x001F2D }, - { "Africa/Tripoli" , 0x001F82 }, - { "Africa/Tunis" , 0x00208B }, - { "Africa/Windhoek" , 0x00219D }, - { "America/Adak" , 0x0023E4 }, - { "America/Anchorage" , 0x00275A }, - { "America/Anguilla" , 0x002ACE }, - { "America/Antigua" , 0x002B23 }, - { "America/Araguaina" , 0x002B89 }, - { "America/Argentina/Buenos_Aires" , 0x002CEE }, - { "America/Argentina/Catamarca" , 0x002E9C }, - { "America/Argentina/ComodRivadavia" , 0x00305D }, - { "America/Argentina/Cordoba" , 0x003203 }, - { "America/Argentina/Jujuy" , 0x0033D8 }, - { "America/Argentina/La_Rioja" , 0x00358C }, - { "America/Argentina/Mendoza" , 0x003744 }, - { "America/Argentina/Rio_Gallegos" , 0x003904 }, - { "America/Argentina/Salta" , 0x003AB9 }, - { "America/Argentina/San_Juan" , 0x003C65 }, - { "America/Argentina/San_Luis" , 0x003E1D }, - { "America/Argentina/Tucuman" , 0x003FE3 }, - { "America/Argentina/Ushuaia" , 0x00419F }, - { "America/Aruba" , 0x00435A }, - { "America/Asuncion" , 0x0043C0 }, - { "America/Atikokan" , 0x0046A5 }, - { "America/Atka" , 0x00477B }, - { "America/Bahia" , 0x004AE1 }, - { "America/Bahia_Banderas" , 0x004C74 }, - { "America/Barbados" , 0x004EED }, - { "America/Belem" , 0x004F87 }, - { "America/Belize" , 0x005082 }, - { "America/Blanc-Sablon" , 0x0051FE }, - { "America/Boa_Vista" , 0x0052B2 }, - { "America/Bogota" , 0x0053BB }, - { "America/Boise" , 0x005427 }, - { "America/Buenos_Aires" , 0x0057BE }, - { "America/Cambridge_Bay" , 0x005957 }, - { "America/Campo_Grande" , 0x005C7F }, - { "America/Cancun" , 0x005F6E }, - { "America/Caracas" , 0x0061B0 }, - { "America/Catamarca" , 0x006217 }, - { "America/Cayenne" , 0x0063BD }, - { "America/Cayman" , 0x00641F }, - { "America/Chicago" , 0x006474 }, - { "America/Chihuahua" , 0x00698B }, - { "America/Coral_Harbour" , 0x006BF6 }, - { "America/Cordoba" , 0x006C88 }, - { "America/Costa_Rica" , 0x006E2E }, - { "America/Creston" , 0x006EB8 }, - { "America/Cuiaba" , 0x006F44 }, - { "America/Curacao" , 0x007222 }, - { "America/Danmarkshavn" , 0x007288 }, - { "America/Dawson" , 0x0073CC }, - { "America/Dawson_Creek" , 0x0076E9 }, - { "America/Denver" , 0x0078C3 }, - { "America/Detroit" , 0x007C49 }, - { "America/Dominica" , 0x007FA8 }, - { "America/Edmonton" , 0x007FFD }, - { "America/Eirunepe" , 0x0083B5 }, - { "America/El_Salvador" , 0x0084CD }, - { "America/Ensenada" , 0x008542 }, - { "America/Fort_Wayne" , 0x0089E9 }, - { "America/Fortaleza" , 0x0088AB }, - { "America/Glace_Bay" , 0x008C53 }, - { "America/Godthab" , 0x008FCA }, - { "America/Goose_Bay" , 0x00928E }, - { "America/Grand_Turk" , 0x00974B }, - { "America/Grenada" , 0x009920 }, - { "America/Guadeloupe" , 0x009975 }, - { "America/Guatemala" , 0x0099CA }, - { "America/Guayaquil" , 0x009A53 }, - { "America/Guyana" , 0x009AB0 }, - { "America/Halifax" , 0x009B31 }, - { "America/Havana" , 0x00A047 }, - { "America/Hermosillo" , 0x00A3BA }, - { "America/Indiana/Indianapolis" , 0x00A498 }, - { "America/Indiana/Knox" , 0x00A729 }, - { "America/Indiana/Marengo" , 0x00AAC0 }, - { "America/Indiana/Petersburg" , 0x00AD66 }, - { "America/Indiana/Tell_City" , 0x00B2B3 }, - { "America/Indiana/Vevay" , 0x00B54C }, - { "America/Indiana/Vincennes" , 0x00B787 }, - { "America/Indiana/Winamac" , 0x00BA3B }, - { "America/Indianapolis" , 0x00B049 }, - { "America/Inuvik" , 0x00BCF4 }, - { "America/Iqaluit" , 0x00BFEB }, - { "America/Jamaica" , 0x00C30D }, - { "America/Jujuy" , 0x00C3D2 }, - { "America/Juneau" , 0x00C57C }, - { "America/Kentucky/Louisville" , 0x00C8FA }, - { "America/Kentucky/Monticello" , 0x00CD18 }, - { "America/Knox_IN" , 0x00D09D }, - { "America/Kralendijk" , 0x00D40E }, - { "America/La_Paz" , 0x00D474 }, - { "America/Lima" , 0x00D4DB }, - { "America/Los_Angeles" , 0x00D583 }, - { "America/Louisville" , 0x00D994 }, - { "America/Lower_Princes" , 0x00DD89 }, - { "America/Maceio" , 0x00DDEF }, - { "America/Managua" , 0x00DF29 }, - { "America/Manaus" , 0x00DFDC }, - { "America/Marigot" , 0x00E0DE }, - { "America/Martinique" , 0x00E133 }, - { "America/Matamoros" , 0x00E19F }, - { "America/Mazatlan" , 0x00E3F8 }, - { "America/Mendoza" , 0x00E665 }, - { "America/Menominee" , 0x00E819 }, - { "America/Merida" , 0x00EB9A }, - { "America/Metlakatla" , 0x00EDD5 }, - { "America/Mexico_City" , 0x00EF10 }, - { "America/Miquelon" , 0x00F18B }, - { "America/Moncton" , 0x00F3FD }, - { "America/Monterrey" , 0x00F894 }, - { "America/Montevideo" , 0x00FAF7 }, - { "America/Montreal" , 0x00FE09 }, - { "America/Montserrat" , 0x0102F9 }, - { "America/Nassau" , 0x01034E }, - { "America/New_York" , 0x010693 }, - { "America/Nipigon" , 0x010B9E }, - { "America/Nome" , 0x010EEF }, - { "America/Noronha" , 0x01126D }, - { "America/North_Dakota/Beulah" , 0x01139D }, - { "America/North_Dakota/Center" , 0x011731 }, - { "America/North_Dakota/New_Salem" , 0x011AC5 }, - { "America/Ojinaga" , 0x011E6E }, - { "America/Panama" , 0x0120CF }, - { "America/Pangnirtung" , 0x012124 }, - { "America/Paramaribo" , 0x01245A }, - { "America/Phoenix" , 0x0124EC }, - { "America/Port-au-Prince" , 0x0125AA }, - { "America/Port_of_Spain" , 0x0128CE }, - { "America/Porto_Acre" , 0x0127CA }, - { "America/Porto_Velho" , 0x012923 }, - { "America/Puerto_Rico" , 0x012A19 }, - { "America/Rainy_River" , 0x012A84 }, - { "America/Rankin_Inlet" , 0x012DBC }, - { "America/Recife" , 0x0130A2 }, - { "America/Regina" , 0x0131CC }, - { "America/Resolute" , 0x01338A }, - { "America/Rio_Branco" , 0x013672 }, - { "America/Rosario" , 0x01377A }, - { "America/Santa_Isabel" , 0x013920 }, - { "America/Santarem" , 0x013CC3 }, - { "America/Santiago" , 0x013DC8 }, - { "America/Santo_Domingo" , 0x014171 }, - { "America/Sao_Paulo" , 0x014237 }, - { "America/Scoresbysund" , 0x014546 }, - { "America/Shiprock" , 0x014834 }, - { "America/Sitka" , 0x014BAD }, - { "America/St_Barthelemy" , 0x014F35 }, - { "America/St_Johns" , 0x014F8A }, - { "America/St_Kitts" , 0x0154DD }, - { "America/St_Lucia" , 0x015532 }, - { "America/St_Thomas" , 0x015587 }, - { "America/St_Vincent" , 0x0155DC }, - { "America/Swift_Current" , 0x015631 }, - { "America/Tegucigalpa" , 0x015752 }, - { "America/Thule" , 0x0157D1 }, - { "America/Thunder_Bay" , 0x015A18 }, - { "America/Tijuana" , 0x015D61 }, - { "America/Toronto" , 0x0160FA }, - { "America/Tortola" , 0x01661A }, - { "America/Vancouver" , 0x01666F }, - { "America/Virgin" , 0x016AAC }, - { "America/Whitehorse" , 0x016B01 }, - { "America/Winnipeg" , 0x016E1E }, - { "America/Yakutat" , 0x01725E }, - { "America/Yellowknife" , 0x0175C9 }, - { "Antarctica/Casey" , 0x0178D9 }, - { "Antarctica/Davis" , 0x017977 }, - { "Antarctica/DumontDUrville" , 0x017A18 }, - { "Antarctica/Macquarie" , 0x017AA9 }, - { "Antarctica/Mawson" , 0x017CF6 }, - { "Antarctica/McMurdo" , 0x017D72 }, - { "Antarctica/Palmer" , 0x01811D }, - { "Antarctica/Rothera" , 0x018439 }, - { "Antarctica/South_Pole" , 0x0184AF }, - { "Antarctica/Syowa" , 0x01882D }, - { "Antarctica/Troll" , 0x01889B }, - { "Antarctica/Vostok" , 0x018A6D }, - { "Arctic/Longyearbyen" , 0x018ADE }, - { "Asia/Aden" , 0x018E10 }, - { "Asia/Almaty" , 0x018E65 }, - { "Asia/Amman" , 0x018FE4 }, - { "Asia/Anadyr" , 0x01929A }, - { "Asia/Aqtau" , 0x01949C }, - { "Asia/Aqtobe" , 0x01969B }, - { "Asia/Ashgabat" , 0x019853 }, - { "Asia/Ashkhabad" , 0x019970 }, - { "Asia/Baghdad" , 0x019A8D }, - { "Asia/Bahrain" , 0x019C02 }, - { "Asia/Baku" , 0x019C68 }, - { "Asia/Bangkok" , 0x019F50 }, - { "Asia/Beirut" , 0x019FA5 }, - { "Asia/Bishkek" , 0x01A2B2 }, - { "Asia/Brunei" , 0x01A45E }, - { "Asia/Calcutta" , 0x01A4C0 }, - { "Asia/Chita" , 0x01A539 }, - { "Asia/Choibalsan" , 0x01A74E }, - { "Asia/Chongqing" , 0x01A8C7 }, - { "Asia/Chungking" , 0x01A967 }, - { "Asia/Colombo" , 0x01AA07 }, - { "Asia/Dacca" , 0x01AAA3 }, - { "Asia/Damascus" , 0x01AB49 }, - { "Asia/Dhaka" , 0x01AE99 }, - { "Asia/Dili" , 0x01AF3F }, - { "Asia/Dubai" , 0x01AFC9 }, - { "Asia/Dushanbe" , 0x01B01E }, - { "Asia/Gaza" , 0x01B121 }, - { "Asia/Harbin" , 0x01B474 }, - { "Asia/Hebron" , 0x01B514 }, - { "Asia/Ho_Chi_Minh" , 0x01B870 }, - { "Asia/Hong_Kong" , 0x01B8E8 }, - { "Asia/Hovd" , 0x01BAAA }, - { "Asia/Irkutsk" , 0x01BC22 }, - { "Asia/Istanbul" , 0x01BE0D }, - { "Asia/Jakarta" , 0x01C1FA }, - { "Asia/Jayapura" , 0x01C2A4 }, - { "Asia/Jerusalem" , 0x01C341 }, - { "Asia/Kabul" , 0x01C670 }, - { "Asia/Kamchatka" , 0x01C6C1 }, - { "Asia/Karachi" , 0x01C8BA }, - { "Asia/Kashgar" , 0x01C96F }, - { "Asia/Kathmandu" , 0x01C9C4 }, - { "Asia/Katmandu" , 0x01CA2A }, - { "Asia/Khandyga" , 0x01CA90 }, - { "Asia/Kolkata" , 0x01CCBA }, - { "Asia/Krasnoyarsk" , 0x01CD33 }, - { "Asia/Kuala_Lumpur" , 0x01CF20 }, - { "Asia/Kuching" , 0x01CFDD }, - { "Asia/Kuwait" , 0x01D0CB }, - { "Asia/Macao" , 0x01D120 }, - { "Asia/Macau" , 0x01D25B }, - { "Asia/Magadan" , 0x01D396 }, - { "Asia/Makassar" , 0x01D59A }, - { "Asia/Manila" , 0x01D65F }, - { "Asia/Muscat" , 0x01D6E4 }, - { "Asia/Nicosia" , 0x01D739 }, - { "Asia/Novokuznetsk" , 0x01DA21 }, - { "Asia/Novosibirsk" , 0x01DC41 }, - { "Asia/Omsk" , 0x01DE31 }, - { "Asia/Oral" , 0x01E01D }, - { "Asia/Phnom_Penh" , 0x01E1ED }, - { "Asia/Pontianak" , 0x01E265 }, - { "Asia/Pyongyang" , 0x01E327 }, - { "Asia/Qatar" , 0x01E3B7 }, - { "Asia/Qyzylorda" , 0x01E41D }, - { "Asia/Rangoon" , 0x01E5F3 }, - { "Asia/Riyadh" , 0x01E66B }, - { "Asia/Saigon" , 0x01E6C0 }, - { "Asia/Sakhalin" , 0x01E738 }, - { "Asia/Samarkand" , 0x01E935 }, - { "Asia/Seoul" , 0x01EA6B }, - { "Asia/Shanghai" , 0x01EB32 }, - { "Asia/Singapore" , 0x01EBDE }, - { "Asia/Srednekolymsk" , 0x01EC95 }, - { "Asia/Taipei" , 0x01EE95 }, - { "Asia/Tashkent" , 0x01EFC6 }, - { "Asia/Tbilisi" , 0x01F0F7 }, - { "Asia/Tehran" , 0x01F2B1 }, - { "Asia/Tel_Aviv" , 0x01F51F }, - { "Asia/Thimbu" , 0x01F84E }, - { "Asia/Thimphu" , 0x01F8B4 }, - { "Asia/Tokyo" , 0x01F91A }, - { "Asia/Ujung_Pandang" , 0x01F9A4 }, - { "Asia/Ulaanbaatar" , 0x01FA21 }, - { "Asia/Ulan_Bator" , 0x01FB7C }, - { "Asia/Urumqi" , 0x01FCC9 }, - { "Asia/Ust-Nera" , 0x01FD2B }, - { "Asia/Vientiane" , 0x01FF3D }, - { "Asia/Vladivostok" , 0x01FFB5 }, - { "Asia/Yakutsk" , 0x02019F }, - { "Asia/Yekaterinburg" , 0x020389 }, - { "Asia/Yerevan" , 0x0205AA }, - { "Atlantic/Azores" , 0x0207AA }, - { "Atlantic/Bermuda" , 0x020CAD }, - { "Atlantic/Canary" , 0x020F8E }, - { "Atlantic/Cape_Verde" , 0x021264 }, - { "Atlantic/Faeroe" , 0x0212DD }, - { "Atlantic/Faroe" , 0x021581 }, - { "Atlantic/Jan_Mayen" , 0x021825 }, - { "Atlantic/Madeira" , 0x021B57 }, - { "Atlantic/Reykjavik" , 0x022060 }, - { "Atlantic/South_Georgia" , 0x022219 }, - { "Atlantic/St_Helena" , 0x02242B }, - { "Atlantic/Stanley" , 0x02225D }, - { "Australia/ACT" , 0x022480 }, - { "Australia/Adelaide" , 0x0227A3 }, - { "Australia/Brisbane" , 0x022AD5 }, - { "Australia/Broken_Hill" , 0x022BA2 }, - { "Australia/Canberra" , 0x022EE6 }, - { "Australia/Currie" , 0x023209 }, - { "Australia/Darwin" , 0x023542 }, - { "Australia/Eucla" , 0x0235CE }, - { "Australia/Hobart" , 0x0236AA }, - { "Australia/LHI" , 0x023A0E }, - { "Australia/Lindeman" , 0x023CAF }, - { "Australia/Lord_Howe" , 0x023D96 }, - { "Australia/Melbourne" , 0x024047 }, - { "Australia/North" , 0x024372 }, - { "Australia/NSW" , 0x0243EC }, - { "Australia/Perth" , 0x02470F }, - { "Australia/Queensland" , 0x0247ED }, - { "Australia/South" , 0x02489F }, - { "Australia/Sydney" , 0x024BC2 }, - { "Australia/Tasmania" , 0x024F05 }, - { "Australia/Victoria" , 0x025250 }, - { "Australia/West" , 0x025573 }, - { "Australia/Yancowinna" , 0x02562F }, - { "Brazil/Acre" , 0x025957 }, - { "Brazil/DeNoronha" , 0x025A5B }, - { "Brazil/East" , 0x025B7B }, - { "Brazil/West" , 0x025E58 }, - { "Canada/Atlantic" , 0x025F50 }, - { "Canada/Central" , 0x026438 }, - { "Canada/East-Saskatchewan" , 0x026D42 }, - { "Canada/Eastern" , 0x026852 }, - { "Canada/Mountain" , 0x026ECB }, - { "Canada/Newfoundland" , 0x027241 }, - { "Canada/Pacific" , 0x02776C }, - { "Canada/Saskatchewan" , 0x027B85 }, - { "Canada/Yukon" , 0x027D0E }, - { "CET" , 0x028011 }, - { "Chile/Continental" , 0x02831A }, - { "Chile/EasterIsland" , 0x0286B5 }, - { "CST6CDT" , 0x0289F7 }, - { "Cuba" , 0x028D48 }, - { "EET" , 0x0290BB }, - { "Egypt" , 0x02936E }, - { "Eire" , 0x029755 }, - { "EST" , 0x029C66 }, - { "EST5EDT" , 0x029CAA }, - { "Etc/GMT" , 0x029FFB }, - { "Etc/GMT+0" , 0x02A0C7 }, - { "Etc/GMT+1" , 0x02A151 }, - { "Etc/GMT+10" , 0x02A1DE }, - { "Etc/GMT+11" , 0x02A26C }, - { "Etc/GMT+12" , 0x02A2FA }, - { "Etc/GMT+2" , 0x02A415 }, - { "Etc/GMT+3" , 0x02A4A1 }, - { "Etc/GMT+4" , 0x02A52D }, - { "Etc/GMT+5" , 0x02A5B9 }, - { "Etc/GMT+6" , 0x02A645 }, - { "Etc/GMT+7" , 0x02A6D1 }, - { "Etc/GMT+8" , 0x02A75D }, - { "Etc/GMT+9" , 0x02A7E9 }, - { "Etc/GMT-0" , 0x02A083 }, - { "Etc/GMT-1" , 0x02A10B }, - { "Etc/GMT-10" , 0x02A197 }, - { "Etc/GMT-11" , 0x02A225 }, - { "Etc/GMT-12" , 0x02A2B3 }, - { "Etc/GMT-13" , 0x02A341 }, - { "Etc/GMT-14" , 0x02A388 }, - { "Etc/GMT-2" , 0x02A3CF }, - { "Etc/GMT-3" , 0x02A45B }, - { "Etc/GMT-4" , 0x02A4E7 }, - { "Etc/GMT-5" , 0x02A573 }, - { "Etc/GMT-6" , 0x02A5FF }, - { "Etc/GMT-7" , 0x02A68B }, - { "Etc/GMT-8" , 0x02A717 }, - { "Etc/GMT-9" , 0x02A7A3 }, - { "Etc/GMT0" , 0x02A03F }, - { "Etc/Greenwich" , 0x02A82F }, - { "Etc/UCT" , 0x02A873 }, - { "Etc/Universal" , 0x02A8B7 }, - { "Etc/UTC" , 0x02A8FB }, - { "Etc/Zulu" , 0x02A93F }, - { "Europe/Amsterdam" , 0x02A983 }, - { "Europe/Andorra" , 0x02ADC1 }, - { "Europe/Athens" , 0x02B03D }, - { "Europe/Belfast" , 0x02B380 }, - { "Europe/Belgrade" , 0x02B8B7 }, - { "Europe/Berlin" , 0x02BB80 }, - { "Europe/Bratislava" , 0x02BEE4 }, - { "Europe/Brussels" , 0x02C216 }, - { "Europe/Bucharest" , 0x02C64D }, - { "Europe/Budapest" , 0x02C977 }, - { "Europe/Busingen" , 0x02CCE0 }, - { "Europe/Chisinau" , 0x02CF97 }, - { "Europe/Copenhagen" , 0x02D325 }, - { "Europe/Dublin" , 0x02D62F }, - { "Europe/Gibraltar" , 0x02DB40 }, - { "Europe/Guernsey" , 0x02DF97 }, - { "Europe/Helsinki" , 0x02E4CE }, - { "Europe/Isle_of_Man" , 0x02E784 }, - { "Europe/Istanbul" , 0x02ECBB }, - { "Europe/Jersey" , 0x02F0A8 }, - { "Europe/Kaliningrad" , 0x02F5DF }, - { "Europe/Kiev" , 0x02F84A }, - { "Europe/Lisbon" , 0x02FB66 }, - { "Europe/Ljubljana" , 0x03006A }, - { "Europe/London" , 0x030333 }, - { "Europe/Luxembourg" , 0x03086A }, - { "Europe/Madrid" , 0x030CC0 }, - { "Europe/Malta" , 0x031086 }, - { "Europe/Mariehamn" , 0x03143F }, - { "Europe/Minsk" , 0x0316F5 }, - { "Europe/Monaco" , 0x031903 }, - { "Europe/Moscow" , 0x031D3E }, - { "Europe/Nicosia" , 0x031F98 }, - { "Europe/Oslo" , 0x032280 }, - { "Europe/Paris" , 0x0325B2 }, - { "Europe/Podgorica" , 0x0329F8 }, - { "Europe/Prague" , 0x032CC1 }, - { "Europe/Riga" , 0x032FF3 }, - { "Europe/Rome" , 0x033338 }, - { "Europe/Samara" , 0x0336FB }, - { "Europe/San_Marino" , 0x033964 }, - { "Europe/Sarajevo" , 0x033D27 }, - { "Europe/Simferopol" , 0x033FF0 }, - { "Europe/Skopje" , 0x034241 }, - { "Europe/Sofia" , 0x03450A }, - { "Europe/Stockholm" , 0x034812 }, - { "Europe/Tallinn" , 0x034AC1 }, - { "Europe/Tirane" , 0x034DFB }, - { "Europe/Tiraspol" , 0x035101 }, - { "Europe/Uzhgorod" , 0x03548F }, - { "Europe/Vaduz" , 0x0357A6 }, - { "Europe/Vatican" , 0x035A55 }, - { "Europe/Vienna" , 0x035E18 }, - { "Europe/Vilnius" , 0x036145 }, - { "Europe/Volgograd" , 0x036484 }, - { "Europe/Warsaw" , 0x0366A5 }, - { "Europe/Zagreb" , 0x036A86 }, - { "Europe/Zaporozhye" , 0x036D4F }, - { "Europe/Zurich" , 0x037090 }, - { "Factory" , 0x03733F }, - { "GB" , 0x0373B0 }, - { "GB-Eire" , 0x0378E7 }, - { "GMT" , 0x037E1E }, - { "GMT+0" , 0x037EEA }, - { "GMT-0" , 0x037EA6 }, - { "GMT0" , 0x037E62 }, - { "Greenwich" , 0x037F2E }, - { "Hongkong" , 0x037F72 }, - { "HST" , 0x038134 }, - { "Iceland" , 0x038178 }, - { "Indian/Antananarivo" , 0x038331 }, - { "Indian/Chagos" , 0x0383A5 }, - { "Indian/Christmas" , 0x038407 }, - { "Indian/Cocos" , 0x03844B }, - { "Indian/Comoro" , 0x03848F }, - { "Indian/Kerguelen" , 0x0384E4 }, - { "Indian/Mahe" , 0x038539 }, - { "Indian/Maldives" , 0x03858E }, - { "Indian/Mauritius" , 0x0385E3 }, - { "Indian/Mayotte" , 0x038659 }, - { "Indian/Reunion" , 0x0386AE }, - { "Iran" , 0x038703 }, - { "Israel" , 0x038971 }, - { "Jamaica" , 0x038CA0 }, - { "Japan" , 0x038D65 }, - { "Kwajalein" , 0x038DEF }, - { "Libya" , 0x038E52 }, - { "MET" , 0x038F5B }, - { "Mexico/BajaNorte" , 0x039264 }, - { "Mexico/BajaSur" , 0x0395CD }, - { "Mexico/General" , 0x039812 }, - { "MST" , 0x039A70 }, - { "MST7MDT" , 0x039AB4 }, - { "Navajo" , 0x039E05 }, - { "NZ" , 0x03A17E }, - { "NZ-CHAT" , 0x03A4FC }, - { "Pacific/Apia" , 0x03A7E0 }, - { "Pacific/Auckland" , 0x03A97C }, - { "Pacific/Chatham" , 0x03AD08 }, - { "Pacific/Chuuk" , 0x03AFFB }, - { "Pacific/Easter" , 0x03B054 }, - { "Pacific/Efate" , 0x03B3A3 }, - { "Pacific/Enderbury" , 0x03B469 }, - { "Pacific/Fakaofo" , 0x03B4D7 }, - { "Pacific/Fiji" , 0x03B528 }, - { "Pacific/Funafuti" , 0x03B6BB }, - { "Pacific/Galapagos" , 0x03B6FF }, - { "Pacific/Gambier" , 0x03B777 }, - { "Pacific/Guadalcanal" , 0x03B7DC }, - { "Pacific/Guam" , 0x03B831 }, - { "Pacific/Honolulu" , 0x03B887 }, - { "Pacific/Johnston" , 0x03B8FE }, - { "Pacific/Kiritimati" , 0x03B97D }, - { "Pacific/Kosrae" , 0x03B9E8 }, - { "Pacific/Kwajalein" , 0x03BA45 }, - { "Pacific/Majuro" , 0x03BAB1 }, - { "Pacific/Marquesas" , 0x03BB10 }, - { "Pacific/Midway" , 0x03BB77 }, - { "Pacific/Nauru" , 0x03BC01 }, - { "Pacific/Niue" , 0x03BC79 }, - { "Pacific/Norfolk" , 0x03BCD7 }, - { "Pacific/Noumea" , 0x03BD2C }, - { "Pacific/Pago_Pago" , 0x03BDBC }, - { "Pacific/Palau" , 0x03BE33 }, - { "Pacific/Pitcairn" , 0x03BE77 }, - { "Pacific/Pohnpei" , 0x03BECC }, - { "Pacific/Ponape" , 0x03BF21 }, - { "Pacific/Port_Moresby" , 0x03BF66 }, - { "Pacific/Rarotonga" , 0x03BFAA }, - { "Pacific/Saipan" , 0x03C086 }, - { "Pacific/Samoa" , 0x03C0E9 }, - { "Pacific/Tahiti" , 0x03C160 }, - { "Pacific/Tarawa" , 0x03C1C5 }, - { "Pacific/Tongatapu" , 0x03C219 }, - { "Pacific/Truk" , 0x03C2A5 }, - { "Pacific/Wake" , 0x03C2EA }, - { "Pacific/Wallis" , 0x03C33A }, - { "Pacific/Yap" , 0x03C37E }, - { "Poland" , 0x03C3C3 }, - { "Portugal" , 0x03C7A4 }, - { "PRC" , 0x03CCA0 }, - { "PST8PDT" , 0x03CD40 }, - { "ROC" , 0x03D091 }, - { "ROK" , 0x03D1C2 }, - { "Singapore" , 0x03D289 }, - { "Turkey" , 0x03D340 }, - { "UCT" , 0x03D72D }, - { "Universal" , 0x03D771 }, - { "US/Alaska" , 0x03D7B5 }, - { "US/Aleutian" , 0x03DB1E }, - { "US/Arizona" , 0x03DE84 }, - { "US/Central" , 0x03DF12 }, - { "US/East-Indiana" , 0x03E91C }, - { "US/Eastern" , 0x03E41D }, - { "US/Hawaii" , 0x03EB86 }, - { "US/Indiana-Starke" , 0x03EBF7 }, - { "US/Michigan" , 0x03EF68 }, - { "US/Mountain" , 0x03F29F }, - { "US/Pacific" , 0x03F618 }, - { "US/Pacific-New" , 0x03FA1D }, - { "US/Samoa" , 0x03FE22 }, - { "UTC" , 0x03FE99 }, - { "W-SU" , 0x040190 }, - { "WET" , 0x03FEDD }, - { "Zulu" , 0x0403D3 }, + { "Africa/Algiers" , 0x00021C }, + { "Africa/Asmara" , 0x000347 }, + { "Africa/Asmera" , 0x0003C6 }, + { "Africa/Bamako" , 0x000445 }, + { "Africa/Bangui" , 0x00049A }, + { "Africa/Banjul" , 0x0004EF }, + { "Africa/Bissau" , 0x000544 }, + { "Africa/Blantyre" , 0x0005AA }, + { "Africa/Brazzaville" , 0x0005FF }, + { "Africa/Bujumbura" , 0x000654 }, + { "Africa/Cairo" , 0x0006A9 }, + { "Africa/Casablanca" , 0x000A90 }, + { "Africa/Ceuta" , 0x000CF2 }, + { "Africa/Conakry" , 0x000FF9 }, + { "Africa/Dakar" , 0x00104E }, + { "Africa/Dar_es_Salaam" , 0x0010A3 }, + { "Africa/Djibouti" , 0x001122 }, + { "Africa/Douala" , 0x0011A1 }, + { "Africa/El_Aaiun" , 0x0011F6 }, + { "Africa/Freetown" , 0x001421 }, + { "Africa/Gaborone" , 0x001476 }, + { "Africa/Harare" , 0x0014CB }, + { "Africa/Johannesburg" , 0x001520 }, + { "Africa/Juba" , 0x00158E }, + { "Africa/Kampala" , 0x0016A1 }, + { "Africa/Khartoum" , 0x001720 }, + { "Africa/Kigali" , 0x001833 }, + { "Africa/Kinshasa" , 0x001888 }, + { "Africa/Lagos" , 0x0018F4 }, + { "Africa/Libreville" , 0x001949 }, + { "Africa/Lome" , 0x00199E }, + { "Africa/Luanda" , 0x0019F3 }, + { "Africa/Lubumbashi" , 0x001A48 }, + { "Africa/Lusaka" , 0x001AB4 }, + { "Africa/Malabo" , 0x001B09 }, + { "Africa/Maputo" , 0x001B5E }, + { "Africa/Maseru" , 0x001BB3 }, + { "Africa/Mbabane" , 0x001C21 }, + { "Africa/Mogadishu" , 0x001C8F }, + { "Africa/Monrovia" , 0x001D0E }, + { "Africa/Nairobi" , 0x001D74 }, + { "Africa/Ndjamena" , 0x001DF3 }, + { "Africa/Niamey" , 0x001E5F }, + { "Africa/Nouakchott" , 0x001EB4 }, + { "Africa/Ouagadougou" , 0x001F09 }, + { "Africa/Porto-Novo" , 0x001F5E }, + { "Africa/Sao_Tome" , 0x001FB3 }, + { "Africa/Timbuktu" , 0x002008 }, + { "Africa/Tripoli" , 0x00205D }, + { "Africa/Tunis" , 0x002166 }, + { "Africa/Windhoek" , 0x002278 }, + { "America/Adak" , 0x0024BF }, + { "America/Anchorage" , 0x002835 }, + { "America/Anguilla" , 0x002BA9 }, + { "America/Antigua" , 0x002BFE }, + { "America/Araguaina" , 0x002C64 }, + { "America/Argentina/Buenos_Aires" , 0x002DC9 }, + { "America/Argentina/Catamarca" , 0x002F77 }, + { "America/Argentina/ComodRivadavia" , 0x003138 }, + { "America/Argentina/Cordoba" , 0x0032DE }, + { "America/Argentina/Jujuy" , 0x0034B3 }, + { "America/Argentina/La_Rioja" , 0x003667 }, + { "America/Argentina/Mendoza" , 0x00381F }, + { "America/Argentina/Rio_Gallegos" , 0x0039DF }, + { "America/Argentina/Salta" , 0x003B94 }, + { "America/Argentina/San_Juan" , 0x003D40 }, + { "America/Argentina/San_Luis" , 0x003EF8 }, + { "America/Argentina/Tucuman" , 0x0040BE }, + { "America/Argentina/Ushuaia" , 0x00427A }, + { "America/Aruba" , 0x004435 }, + { "America/Asuncion" , 0x00449B }, + { "America/Atikokan" , 0x004780 }, + { "America/Atka" , 0x004856 }, + { "America/Bahia" , 0x004BBC }, + { "America/Bahia_Banderas" , 0x004D4F }, + { "America/Barbados" , 0x004FC8 }, + { "America/Belem" , 0x005062 }, + { "America/Belize" , 0x00515D }, + { "America/Blanc-Sablon" , 0x0052D9 }, + { "America/Boa_Vista" , 0x00538D }, + { "America/Bogota" , 0x005496 }, + { "America/Boise" , 0x005502 }, + { "America/Buenos_Aires" , 0x005899 }, + { "America/Cambridge_Bay" , 0x005A32 }, + { "America/Campo_Grande" , 0x005D5A }, + { "America/Cancun" , 0x006049 }, + { "America/Caracas" , 0x00628B }, + { "America/Catamarca" , 0x0062F2 }, + { "America/Cayenne" , 0x006498 }, + { "America/Cayman" , 0x0064FA }, + { "America/Chicago" , 0x00654F }, + { "America/Chihuahua" , 0x006A66 }, + { "America/Coral_Harbour" , 0x006CD1 }, + { "America/Cordoba" , 0x006D63 }, + { "America/Costa_Rica" , 0x006F09 }, + { "America/Creston" , 0x006F93 }, + { "America/Cuiaba" , 0x00701F }, + { "America/Curacao" , 0x0072FD }, + { "America/Danmarkshavn" , 0x007363 }, + { "America/Dawson" , 0x0074A7 }, + { "America/Dawson_Creek" , 0x0077C4 }, + { "America/Denver" , 0x00799E }, + { "America/Detroit" , 0x007D24 }, + { "America/Dominica" , 0x008083 }, + { "America/Edmonton" , 0x0080D8 }, + { "America/Eirunepe" , 0x008490 }, + { "America/El_Salvador" , 0x0085A8 }, + { "America/Ensenada" , 0x00861D }, + { "America/Fort_Wayne" , 0x008AC4 }, + { "America/Fortaleza" , 0x008986 }, + { "America/Glace_Bay" , 0x008D2E }, + { "America/Godthab" , 0x0090A5 }, + { "America/Goose_Bay" , 0x009369 }, + { "America/Grand_Turk" , 0x009826 }, + { "America/Grenada" , 0x009A05 }, + { "America/Guadeloupe" , 0x009A5A }, + { "America/Guatemala" , 0x009AAF }, + { "America/Guayaquil" , 0x009B38 }, + { "America/Guyana" , 0x009B95 }, + { "America/Halifax" , 0x009C16 }, + { "America/Havana" , 0x00A12C }, + { "America/Hermosillo" , 0x00A49F }, + { "America/Indiana/Indianapolis" , 0x00A57D }, + { "America/Indiana/Knox" , 0x00A80E }, + { "America/Indiana/Marengo" , 0x00ABA5 }, + { "America/Indiana/Petersburg" , 0x00AE4B }, + { "America/Indiana/Tell_City" , 0x00B398 }, + { "America/Indiana/Vevay" , 0x00B631 }, + { "America/Indiana/Vincennes" , 0x00B86C }, + { "America/Indiana/Winamac" , 0x00BB20 }, + { "America/Indianapolis" , 0x00B12E }, + { "America/Inuvik" , 0x00BDD9 }, + { "America/Iqaluit" , 0x00C0D0 }, + { "America/Jamaica" , 0x00C3F2 }, + { "America/Jujuy" , 0x00C4B7 }, + { "America/Juneau" , 0x00C661 }, + { "America/Kentucky/Louisville" , 0x00C9DF }, + { "America/Kentucky/Monticello" , 0x00CDFD }, + { "America/Knox_IN" , 0x00D182 }, + { "America/Kralendijk" , 0x00D4F3 }, + { "America/La_Paz" , 0x00D559 }, + { "America/Lima" , 0x00D5C0 }, + { "America/Los_Angeles" , 0x00D668 }, + { "America/Louisville" , 0x00DA79 }, + { "America/Lower_Princes" , 0x00DE6E }, + { "America/Maceio" , 0x00DED4 }, + { "America/Managua" , 0x00E00E }, + { "America/Manaus" , 0x00E0C1 }, + { "America/Marigot" , 0x00E1C3 }, + { "America/Martinique" , 0x00E218 }, + { "America/Matamoros" , 0x00E284 }, + { "America/Mazatlan" , 0x00E4DD }, + { "America/Mendoza" , 0x00E74A }, + { "America/Menominee" , 0x00E8FE }, + { "America/Merida" , 0x00EC7F }, + { "America/Metlakatla" , 0x00EEBA }, + { "America/Mexico_City" , 0x00EFF5 }, + { "America/Miquelon" , 0x00F270 }, + { "America/Moncton" , 0x00F4E2 }, + { "America/Monterrey" , 0x00F979 }, + { "America/Montevideo" , 0x00FBDC }, + { "America/Montreal" , 0x00FEEE }, + { "America/Montserrat" , 0x0103DE }, + { "America/Nassau" , 0x010433 }, + { "America/New_York" , 0x010778 }, + { "America/Nipigon" , 0x010C83 }, + { "America/Nome" , 0x010FD4 }, + { "America/Noronha" , 0x011352 }, + { "America/North_Dakota/Beulah" , 0x011482 }, + { "America/North_Dakota/Center" , 0x011816 }, + { "America/North_Dakota/New_Salem" , 0x011BAA }, + { "America/Ojinaga" , 0x011F53 }, + { "America/Panama" , 0x0121B4 }, + { "America/Pangnirtung" , 0x012209 }, + { "America/Paramaribo" , 0x01253F }, + { "America/Phoenix" , 0x0125D1 }, + { "America/Port-au-Prince" , 0x01268F }, + { "America/Port_of_Spain" , 0x0129B3 }, + { "America/Porto_Acre" , 0x0128AF }, + { "America/Porto_Velho" , 0x012A08 }, + { "America/Puerto_Rico" , 0x012AFE }, + { "America/Rainy_River" , 0x012B69 }, + { "America/Rankin_Inlet" , 0x012EA1 }, + { "America/Recife" , 0x013187 }, + { "America/Regina" , 0x0132B1 }, + { "America/Resolute" , 0x01346F }, + { "America/Rio_Branco" , 0x013757 }, + { "America/Rosario" , 0x01385F }, + { "America/Santa_Isabel" , 0x013A05 }, + { "America/Santarem" , 0x013DA8 }, + { "America/Santiago" , 0x013EAD }, + { "America/Santo_Domingo" , 0x014256 }, + { "America/Sao_Paulo" , 0x01431C }, + { "America/Scoresbysund" , 0x01462B }, + { "America/Shiprock" , 0x014919 }, + { "America/Sitka" , 0x014C92 }, + { "America/St_Barthelemy" , 0x01501A }, + { "America/St_Johns" , 0x01506F }, + { "America/St_Kitts" , 0x0155C2 }, + { "America/St_Lucia" , 0x015617 }, + { "America/St_Thomas" , 0x01566C }, + { "America/St_Vincent" , 0x0156C1 }, + { "America/Swift_Current" , 0x015716 }, + { "America/Tegucigalpa" , 0x015837 }, + { "America/Thule" , 0x0158B6 }, + { "America/Thunder_Bay" , 0x015AFD }, + { "America/Tijuana" , 0x015E46 }, + { "America/Toronto" , 0x0161DF }, + { "America/Tortola" , 0x0166FF }, + { "America/Vancouver" , 0x016754 }, + { "America/Virgin" , 0x016B91 }, + { "America/Whitehorse" , 0x016BE6 }, + { "America/Winnipeg" , 0x016F03 }, + { "America/Yakutat" , 0x017343 }, + { "America/Yellowknife" , 0x0176AE }, + { "Antarctica/Casey" , 0x0179BE }, + { "Antarctica/Davis" , 0x017A5C }, + { "Antarctica/DumontDUrville" , 0x017AFD }, + { "Antarctica/Macquarie" , 0x017B8E }, + { "Antarctica/Mawson" , 0x017DDB }, + { "Antarctica/McMurdo" , 0x017E57 }, + { "Antarctica/Palmer" , 0x018202 }, + { "Antarctica/Rothera" , 0x01851E }, + { "Antarctica/South_Pole" , 0x018594 }, + { "Antarctica/Syowa" , 0x018912 }, + { "Antarctica/Troll" , 0x018980 }, + { "Antarctica/Vostok" , 0x018B52 }, + { "Arctic/Longyearbyen" , 0x018BC3 }, + { "Asia/Aden" , 0x018EF5 }, + { "Asia/Almaty" , 0x018F4A }, + { "Asia/Amman" , 0x0190C9 }, + { "Asia/Anadyr" , 0x01937F }, + { "Asia/Aqtau" , 0x019581 }, + { "Asia/Aqtobe" , 0x019780 }, + { "Asia/Ashgabat" , 0x019938 }, + { "Asia/Ashkhabad" , 0x019A55 }, + { "Asia/Baghdad" , 0x019B72 }, + { "Asia/Bahrain" , 0x019CE7 }, + { "Asia/Baku" , 0x019D4D }, + { "Asia/Bangkok" , 0x01A035 }, + { "Asia/Beirut" , 0x01A08A }, + { "Asia/Bishkek" , 0x01A397 }, + { "Asia/Brunei" , 0x01A543 }, + { "Asia/Calcutta" , 0x01A5A5 }, + { "Asia/Chita" , 0x01A61E }, + { "Asia/Choibalsan" , 0x01A833 }, + { "Asia/Chongqing" , 0x01A9AC }, + { "Asia/Chungking" , 0x01AA4C }, + { "Asia/Colombo" , 0x01AAEC }, + { "Asia/Dacca" , 0x01AB88 }, + { "Asia/Damascus" , 0x01AC2E }, + { "Asia/Dhaka" , 0x01AF7E }, + { "Asia/Dili" , 0x01B024 }, + { "Asia/Dubai" , 0x01B0AE }, + { "Asia/Dushanbe" , 0x01B103 }, + { "Asia/Gaza" , 0x01B206 }, + { "Asia/Harbin" , 0x01B559 }, + { "Asia/Hebron" , 0x01B5F9 }, + { "Asia/Ho_Chi_Minh" , 0x01B955 }, + { "Asia/Hong_Kong" , 0x01B9F7 }, + { "Asia/Hovd" , 0x01BBB9 }, + { "Asia/Irkutsk" , 0x01BD31 }, + { "Asia/Istanbul" , 0x01BF1C }, + { "Asia/Jakarta" , 0x01C309 }, + { "Asia/Jayapura" , 0x01C3B3 }, + { "Asia/Jerusalem" , 0x01C450 }, + { "Asia/Kabul" , 0x01C77F }, + { "Asia/Kamchatka" , 0x01C7D0 }, + { "Asia/Karachi" , 0x01C9C9 }, + { "Asia/Kashgar" , 0x01CA7E }, + { "Asia/Kathmandu" , 0x01CAD3 }, + { "Asia/Katmandu" , 0x01CB39 }, + { "Asia/Khandyga" , 0x01CB9F }, + { "Asia/Kolkata" , 0x01CDC9 }, + { "Asia/Krasnoyarsk" , 0x01CE42 }, + { "Asia/Kuala_Lumpur" , 0x01D02F }, + { "Asia/Kuching" , 0x01D0EC }, + { "Asia/Kuwait" , 0x01D1DA }, + { "Asia/Macao" , 0x01D22F }, + { "Asia/Macau" , 0x01D36A }, + { "Asia/Magadan" , 0x01D4A5 }, + { "Asia/Makassar" , 0x01D6A9 }, + { "Asia/Manila" , 0x01D76E }, + { "Asia/Muscat" , 0x01D7F3 }, + { "Asia/Nicosia" , 0x01D848 }, + { "Asia/Novokuznetsk" , 0x01DB30 }, + { "Asia/Novosibirsk" , 0x01DD50 }, + { "Asia/Omsk" , 0x01DF40 }, + { "Asia/Oral" , 0x01E12C }, + { "Asia/Phnom_Penh" , 0x01E2FC }, + { "Asia/Pontianak" , 0x01E351 }, + { "Asia/Pyongyang" , 0x01E413 }, + { "Asia/Qatar" , 0x01E498 }, + { "Asia/Qyzylorda" , 0x01E4FE }, + { "Asia/Rangoon" , 0x01E6D4 }, + { "Asia/Riyadh" , 0x01E74C }, + { "Asia/Saigon" , 0x01E7A1 }, + { "Asia/Sakhalin" , 0x01E843 }, + { "Asia/Samarkand" , 0x01EA40 }, + { "Asia/Seoul" , 0x01EB76 }, + { "Asia/Shanghai" , 0x01EC69 }, + { "Asia/Singapore" , 0x01ED15 }, + { "Asia/Srednekolymsk" , 0x01EDCC }, + { "Asia/Taipei" , 0x01EFCC }, + { "Asia/Tashkent" , 0x01F0FD }, + { "Asia/Tbilisi" , 0x01F22E }, + { "Asia/Tehran" , 0x01F3E8 }, + { "Asia/Tel_Aviv" , 0x01F656 }, + { "Asia/Thimbu" , 0x01F985 }, + { "Asia/Thimphu" , 0x01F9EB }, + { "Asia/Tokyo" , 0x01FA51 }, + { "Asia/Ujung_Pandang" , 0x01FADB }, + { "Asia/Ulaanbaatar" , 0x01FB58 }, + { "Asia/Ulan_Bator" , 0x01FCB3 }, + { "Asia/Urumqi" , 0x01FE00 }, + { "Asia/Ust-Nera" , 0x01FE62 }, + { "Asia/Vientiane" , 0x020074 }, + { "Asia/Vladivostok" , 0x0200C9 }, + { "Asia/Yakutsk" , 0x0202B3 }, + { "Asia/Yekaterinburg" , 0x02049D }, + { "Asia/Yerevan" , 0x0206BE }, + { "Atlantic/Azores" , 0x0208BE }, + { "Atlantic/Bermuda" , 0x020DC1 }, + { "Atlantic/Canary" , 0x0210A2 }, + { "Atlantic/Cape_Verde" , 0x021378 }, + { "Atlantic/Faeroe" , 0x0213F1 }, + { "Atlantic/Faroe" , 0x021695 }, + { "Atlantic/Jan_Mayen" , 0x021939 }, + { "Atlantic/Madeira" , 0x021C6B }, + { "Atlantic/Reykjavik" , 0x022174 }, + { "Atlantic/South_Georgia" , 0x02232D }, + { "Atlantic/St_Helena" , 0x02253F }, + { "Atlantic/Stanley" , 0x022371 }, + { "Australia/ACT" , 0x022594 }, + { "Australia/Adelaide" , 0x0228B7 }, + { "Australia/Brisbane" , 0x022BE9 }, + { "Australia/Broken_Hill" , 0x022CB6 }, + { "Australia/Canberra" , 0x022FFA }, + { "Australia/Currie" , 0x02331D }, + { "Australia/Darwin" , 0x023656 }, + { "Australia/Eucla" , 0x0236E2 }, + { "Australia/Hobart" , 0x0237BE }, + { "Australia/LHI" , 0x023B22 }, + { "Australia/Lindeman" , 0x023DC3 }, + { "Australia/Lord_Howe" , 0x023EAA }, + { "Australia/Melbourne" , 0x02415B }, + { "Australia/North" , 0x024486 }, + { "Australia/NSW" , 0x024500 }, + { "Australia/Perth" , 0x024823 }, + { "Australia/Queensland" , 0x024901 }, + { "Australia/South" , 0x0249B3 }, + { "Australia/Sydney" , 0x024CD6 }, + { "Australia/Tasmania" , 0x025019 }, + { "Australia/Victoria" , 0x025364 }, + { "Australia/West" , 0x025687 }, + { "Australia/Yancowinna" , 0x025743 }, + { "Brazil/Acre" , 0x025A6B }, + { "Brazil/DeNoronha" , 0x025B6F }, + { "Brazil/East" , 0x025C8F }, + { "Brazil/West" , 0x025F6C }, + { "Canada/Atlantic" , 0x026064 }, + { "Canada/Central" , 0x02654C }, + { "Canada/East-Saskatchewan" , 0x026E56 }, + { "Canada/Eastern" , 0x026966 }, + { "Canada/Mountain" , 0x026FDF }, + { "Canada/Newfoundland" , 0x027355 }, + { "Canada/Pacific" , 0x027880 }, + { "Canada/Saskatchewan" , 0x027C99 }, + { "Canada/Yukon" , 0x027E22 }, + { "CET" , 0x028125 }, + { "Chile/Continental" , 0x02842E }, + { "Chile/EasterIsland" , 0x0287C9 }, + { "CST6CDT" , 0x028B0B }, + { "Cuba" , 0x028E5C }, + { "EET" , 0x0291CF }, + { "Egypt" , 0x029482 }, + { "Eire" , 0x029869 }, + { "EST" , 0x029D7A }, + { "EST5EDT" , 0x029DBE }, + { "Etc/GMT" , 0x02A10F }, + { "Etc/GMT+0" , 0x02A1DB }, + { "Etc/GMT+1" , 0x02A265 }, + { "Etc/GMT+10" , 0x02A2F2 }, + { "Etc/GMT+11" , 0x02A380 }, + { "Etc/GMT+12" , 0x02A40E }, + { "Etc/GMT+2" , 0x02A529 }, + { "Etc/GMT+3" , 0x02A5B5 }, + { "Etc/GMT+4" , 0x02A641 }, + { "Etc/GMT+5" , 0x02A6CD }, + { "Etc/GMT+6" , 0x02A759 }, + { "Etc/GMT+7" , 0x02A7E5 }, + { "Etc/GMT+8" , 0x02A871 }, + { "Etc/GMT+9" , 0x02A8FD }, + { "Etc/GMT-0" , 0x02A197 }, + { "Etc/GMT-1" , 0x02A21F }, + { "Etc/GMT-10" , 0x02A2AB }, + { "Etc/GMT-11" , 0x02A339 }, + { "Etc/GMT-12" , 0x02A3C7 }, + { "Etc/GMT-13" , 0x02A455 }, + { "Etc/GMT-14" , 0x02A49C }, + { "Etc/GMT-2" , 0x02A4E3 }, + { "Etc/GMT-3" , 0x02A56F }, + { "Etc/GMT-4" , 0x02A5FB }, + { "Etc/GMT-5" , 0x02A687 }, + { "Etc/GMT-6" , 0x02A713 }, + { "Etc/GMT-7" , 0x02A79F }, + { "Etc/GMT-8" , 0x02A82B }, + { "Etc/GMT-9" , 0x02A8B7 }, + { "Etc/GMT0" , 0x02A153 }, + { "Etc/Greenwich" , 0x02A943 }, + { "Etc/UCT" , 0x02A987 }, + { "Etc/Universal" , 0x02A9CB }, + { "Etc/UTC" , 0x02AA0F }, + { "Etc/Zulu" , 0x02AA53 }, + { "Europe/Amsterdam" , 0x02AA97 }, + { "Europe/Andorra" , 0x02AED5 }, + { "Europe/Athens" , 0x02B151 }, + { "Europe/Belfast" , 0x02B494 }, + { "Europe/Belgrade" , 0x02B9CB }, + { "Europe/Berlin" , 0x02BC94 }, + { "Europe/Bratislava" , 0x02BFF8 }, + { "Europe/Brussels" , 0x02C32A }, + { "Europe/Bucharest" , 0x02C761 }, + { "Europe/Budapest" , 0x02CA8B }, + { "Europe/Busingen" , 0x02CDF4 }, + { "Europe/Chisinau" , 0x02D0AB }, + { "Europe/Copenhagen" , 0x02D439 }, + { "Europe/Dublin" , 0x02D743 }, + { "Europe/Gibraltar" , 0x02DC54 }, + { "Europe/Guernsey" , 0x02E0AB }, + { "Europe/Helsinki" , 0x02E5E2 }, + { "Europe/Isle_of_Man" , 0x02E898 }, + { "Europe/Istanbul" , 0x02EDCF }, + { "Europe/Jersey" , 0x02F1BC }, + { "Europe/Kaliningrad" , 0x02F6F3 }, + { "Europe/Kiev" , 0x02F95E }, + { "Europe/Lisbon" , 0x02FC7A }, + { "Europe/Ljubljana" , 0x03017E }, + { "Europe/London" , 0x030447 }, + { "Europe/Luxembourg" , 0x03097E }, + { "Europe/Madrid" , 0x030DD4 }, + { "Europe/Malta" , 0x03119A }, + { "Europe/Mariehamn" , 0x031553 }, + { "Europe/Minsk" , 0x031809 }, + { "Europe/Monaco" , 0x031A1C }, + { "Europe/Moscow" , 0x031E57 }, + { "Europe/Nicosia" , 0x0320B1 }, + { "Europe/Oslo" , 0x032399 }, + { "Europe/Paris" , 0x0326CB }, + { "Europe/Podgorica" , 0x032B11 }, + { "Europe/Prague" , 0x032DDA }, + { "Europe/Riga" , 0x03310C }, + { "Europe/Rome" , 0x033451 }, + { "Europe/Samara" , 0x033814 }, + { "Europe/San_Marino" , 0x033A7D }, + { "Europe/Sarajevo" , 0x033E40 }, + { "Europe/Simferopol" , 0x034109 }, + { "Europe/Skopje" , 0x03435A }, + { "Europe/Sofia" , 0x034623 }, + { "Europe/Stockholm" , 0x03492B }, + { "Europe/Tallinn" , 0x034BDA }, + { "Europe/Tirane" , 0x034F14 }, + { "Europe/Tiraspol" , 0x03521A }, + { "Europe/Uzhgorod" , 0x0355A8 }, + { "Europe/Vaduz" , 0x0358BF }, + { "Europe/Vatican" , 0x035B6E }, + { "Europe/Vienna" , 0x035F31 }, + { "Europe/Vilnius" , 0x03625E }, + { "Europe/Volgograd" , 0x03659D }, + { "Europe/Warsaw" , 0x0367BE }, + { "Europe/Zagreb" , 0x036B9F }, + { "Europe/Zaporozhye" , 0x036E68 }, + { "Europe/Zurich" , 0x0371A9 }, + { "Factory" , 0x037458 }, + { "GB" , 0x0374C9 }, + { "GB-Eire" , 0x037A00 }, + { "GMT" , 0x037F37 }, + { "GMT+0" , 0x038003 }, + { "GMT-0" , 0x037FBF }, + { "GMT0" , 0x037F7B }, + { "Greenwich" , 0x038047 }, + { "Hongkong" , 0x03808B }, + { "HST" , 0x03824D }, + { "Iceland" , 0x038291 }, + { "Indian/Antananarivo" , 0x03844A }, + { "Indian/Chagos" , 0x0384C9 }, + { "Indian/Christmas" , 0x03852B }, + { "Indian/Cocos" , 0x03856F }, + { "Indian/Comoro" , 0x0385B3 }, + { "Indian/Kerguelen" , 0x038632 }, + { "Indian/Mahe" , 0x038687 }, + { "Indian/Maldives" , 0x0386DC }, + { "Indian/Mauritius" , 0x038731 }, + { "Indian/Mayotte" , 0x0387A7 }, + { "Indian/Reunion" , 0x038826 }, + { "Iran" , 0x03887B }, + { "Israel" , 0x038AE9 }, + { "Jamaica" , 0x038E18 }, + { "Japan" , 0x038EDD }, + { "Kwajalein" , 0x038F67 }, + { "Libya" , 0x038FCA }, + { "MET" , 0x0390D3 }, + { "Mexico/BajaNorte" , 0x0393DC }, + { "Mexico/BajaSur" , 0x039745 }, + { "Mexico/General" , 0x03998A }, + { "MST" , 0x039BE8 }, + { "MST7MDT" , 0x039C2C }, + { "Navajo" , 0x039F7D }, + { "NZ" , 0x03A2F6 }, + { "NZ-CHAT" , 0x03A674 }, + { "Pacific/Apia" , 0x03A958 }, + { "Pacific/Auckland" , 0x03AAF4 }, + { "Pacific/Bougainville" , 0x03AE80 }, + { "Pacific/Chatham" , 0x03AEF7 }, + { "Pacific/Chuuk" , 0x03B1EA }, + { "Pacific/Easter" , 0x03B243 }, + { "Pacific/Efate" , 0x03B592 }, + { "Pacific/Enderbury" , 0x03B658 }, + { "Pacific/Fakaofo" , 0x03B6C6 }, + { "Pacific/Fiji" , 0x03B717 }, + { "Pacific/Funafuti" , 0x03B8AA }, + { "Pacific/Galapagos" , 0x03B8EE }, + { "Pacific/Gambier" , 0x03B966 }, + { "Pacific/Guadalcanal" , 0x03B9CB }, + { "Pacific/Guam" , 0x03BA20 }, + { "Pacific/Honolulu" , 0x03BA76 }, + { "Pacific/Johnston" , 0x03BAED }, + { "Pacific/Kiritimati" , 0x03BB6C }, + { "Pacific/Kosrae" , 0x03BBD7 }, + { "Pacific/Kwajalein" , 0x03BC34 }, + { "Pacific/Majuro" , 0x03BCA0 }, + { "Pacific/Marquesas" , 0x03BCFF }, + { "Pacific/Midway" , 0x03BD66 }, + { "Pacific/Nauru" , 0x03BDF0 }, + { "Pacific/Niue" , 0x03BE68 }, + { "Pacific/Norfolk" , 0x03BEC6 }, + { "Pacific/Noumea" , 0x03BF1B }, + { "Pacific/Pago_Pago" , 0x03BFAB }, + { "Pacific/Palau" , 0x03C022 }, + { "Pacific/Pitcairn" , 0x03C066 }, + { "Pacific/Pohnpei" , 0x03C0BB }, + { "Pacific/Ponape" , 0x03C110 }, + { "Pacific/Port_Moresby" , 0x03C155 }, + { "Pacific/Rarotonga" , 0x03C1A7 }, + { "Pacific/Saipan" , 0x03C283 }, + { "Pacific/Samoa" , 0x03C2E6 }, + { "Pacific/Tahiti" , 0x03C35D }, + { "Pacific/Tarawa" , 0x03C3C2 }, + { "Pacific/Tongatapu" , 0x03C416 }, + { "Pacific/Truk" , 0x03C4A2 }, + { "Pacific/Wake" , 0x03C4E7 }, + { "Pacific/Wallis" , 0x03C537 }, + { "Pacific/Yap" , 0x03C57B }, + { "Poland" , 0x03C5C0 }, + { "Portugal" , 0x03C9A1 }, + { "PRC" , 0x03CE9D }, + { "PST8PDT" , 0x03CF3D }, + { "ROC" , 0x03D28E }, + { "ROK" , 0x03D3BF }, + { "Singapore" , 0x03D4B2 }, + { "Turkey" , 0x03D569 }, + { "UCT" , 0x03D956 }, + { "Universal" , 0x03D99A }, + { "US/Alaska" , 0x03D9DE }, + { "US/Aleutian" , 0x03DD47 }, + { "US/Arizona" , 0x03E0AD }, + { "US/Central" , 0x03E13B }, + { "US/East-Indiana" , 0x03EB45 }, + { "US/Eastern" , 0x03E646 }, + { "US/Hawaii" , 0x03EDAF }, + { "US/Indiana-Starke" , 0x03EE20 }, + { "US/Michigan" , 0x03F191 }, + { "US/Mountain" , 0x03F4C8 }, + { "US/Pacific" , 0x03F841 }, + { "US/Pacific-New" , 0x03FC46 }, + { "US/Samoa" , 0x04004B }, + { "UTC" , 0x0400C2 }, + { "W-SU" , 0x0403B9 }, + { "WET" , 0x040106 }, + { "Zulu" , 0x0405FC }, }; /* This is a generated file, do not modify */ -const unsigned char timelib_timezone_db_data_builtin[263191] = { +const unsigned char timelib_timezone_db_data_builtin[263744] = { /* Africa/Abidjan */ @@ -619,11 +620,13 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Africa/Addis_Ababa */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x1C, 0xE5, 0x01, 0x4D, -0xB5, 0xB0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x97, 0x1C, 0xE5, 0x01, 0x4D, 0xB5, 0xB0, 0x00, 0x00, 0x00, 0x00, /* Africa/Algiers */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -648,19 +651,23 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Africa/Asmara */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xB9, 0xD5, 0x01, 0x4D, -0xFD, 0x4D, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xA0, 0xB9, 0xD5, 0x01, 0x4D, 0xFD, 0x4D, 0x00, 0x00, 0x00, 0x00, /* Africa/Asmera */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, /* Africa/Bamako */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -894,20 +901,23 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Africa/Dar_es_Salaam */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0E, 0xB6, 0xA3, 0xD3, 0xAC, -0xD6, 0x9D, 0x7F, 0xD0, 0xEF, 0x12, 0x66, 0xD4, 0x01, 0x02, 0x01, 0x00, 0x00, 0x24, 0xD4, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x7E, 0xF4, 0x00, 0x01, 0x4E, 0x99, 0x8D, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x7E, 0xF4, 0x00, 0x01, 0x4E, 0x99, 0x8D, 0x00, 0x00, 0x00, 0x00, /* Africa/Djibouti */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD2, 0x0C, -0x01, 0x00, 0x00, 0x28, 0x74, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0x07, 0x80, 0x01, 0x54, 0x7F, -0xF8, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x9B, 0x07, 0x80, 0x01, 0x54, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, /* Africa/Douala */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1010,9 +1020,9 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Africa/Kampala */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDF, 0x1C, -0xB4, 0xC2, 0x9A, 0xD0, 0xD6, 0x9D, 0x86, 0xD8, 0xE7, 0x8C, 0x47, 0x54, 0x01, 0x02, 0x03, 0x01, -0x00, 0x00, 0x1E, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, 0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0xCF, 0xF2, 0x01, 0x44, 0x1F, 0x42, 0x00, 0x00, 0x00, 0x00, @@ -1139,11 +1149,13 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Africa/Mogadishu */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xB6, 0xA3, 0xCE, 0x50, -0xE7, 0x8C, 0x4A, 0xD8, 0x01, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x00, 0x00, 0x00, 0x23, 0x28, -0x00, 0x04, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x8C, 0x7B, 0x8A, 0x01, 0x57, 0xE1, 0xDA, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x8C, 0x7B, 0x8A, 0x01, 0x57, 0xE1, 0xDA, 0x00, 0x00, 0x00, 0x00, /* Africa/Monrovia */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3305,7 +3317,7 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* America/Grand_Turk */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x93, 0x0F, 0xB4, 0xFF, +0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x93, 0x0F, 0xB4, 0xFF, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, @@ -3324,15 +3336,15 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, +0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x0C, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E, -0x0A, 0x00, 0x00, 0x00, 0x00, +0x01, 0x02, 0x03, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, +0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0C, 0x4B, 0x4D, 0x54, 0x00, 0x45, +0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E, 0x0A, 0x00, 0x00, 0x00, 0x00, /* America/Grenada */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8304,13 +8316,16 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Asia/Ho_Chi_Minh */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x42, 0x80, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0xBB, 0x78, -0x01, 0xB5, 0x6B, 0x2A, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x88, 0x8C, 0x43, 0x80, +0x91, 0xA3, 0x2B, 0x0A, 0xCD, 0x35, 0xE6, 0x80, 0xD1, 0x59, 0xCE, 0x70, 0xD2, 0x3B, 0x3E, 0xF0, +0xD5, 0x32, 0xBB, 0x10, 0xE4, 0xB6, 0xE4, 0x80, 0xED, 0x2F, 0x98, 0x00, 0x0A, 0x3D, 0xC7, 0x00, +0x01, 0x02, 0x03, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, +0x00, 0x63, 0xF6, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, +0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x4C, 0x4D, 0x54, 0x00, +0x49, 0x43, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0xBB, 0x78, 0x01, 0xB5, 0x6B, 0x2A, 0x00, 0x00, +0x00, 0x00, /* Asia/Hong_Kong */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9046,13 +9061,11 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Asia/Phnom_Penh */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x44, 0x24, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x62, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xF3, 0xF8, -0x01, 0xB2, 0xBF, 0x92, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA2, 0x6A, 0x67, 0xC4, +0x01, 0x00, 0x00, 0x5E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x42, 0x4D, 0x54, +0x00, 0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xF3, 0xF8, 0x01, 0xB2, 0xBF, +0x92, 0x00, 0x00, 0x00, 0x00, /* Asia/Pontianak */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9072,14 +9085,13 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Asia/Pyongyang */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x2F, 0x61, 0x70, -0xE2, 0x4F, 0x29, 0xF0, 0xF0, 0x35, 0x78, 0x80, 0x01, 0x00, 0x01, 0x02, 0x03, 0x04, 0x03, 0x00, -0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, -0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x4B, 0x53, 0x54, -0x00, 0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xDD, 0x22, 0x01, 0xD2, 0x89, 0x98, 0x00, 0x00, 0x00, 0x00, - +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0x8B, 0xD7, 0xF1, 0x9C, +0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x2F, 0x61, 0x70, 0x01, 0x02, 0x03, 0x04, +0x00, 0x00, 0x75, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, +0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x4C, 0x4D, +0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xDD, 0x22, 0x01, 0xD2, 0x89, +0x98, 0x00, 0x00, 0x00, 0x00, /* Asia/Qatar */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x51, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9142,13 +9154,16 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Asia/Saigon */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x42, 0x80, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, -0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x88, 0x8C, 0x43, 0x80, +0x91, 0xA3, 0x2B, 0x0A, 0xCD, 0x35, 0xE6, 0x80, 0xD1, 0x59, 0xCE, 0x70, 0xD2, 0x3B, 0x3E, 0xF0, +0xD5, 0x32, 0xBB, 0x10, 0xE4, 0xB6, 0xE4, 0x80, 0xED, 0x2F, 0x98, 0x00, 0x0A, 0x3D, 0xC7, 0x00, +0x01, 0x02, 0x03, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, +0x00, 0x63, 0xF6, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, +0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x4C, 0x4D, 0x54, 0x00, +0x49, 0x43, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, +0x00, 0x00, /* Asia/Sakhalin */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9209,17 +9224,20 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Asia/Seoul */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, -0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, 0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80, -0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, 0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70, -0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x02, 0x03, 0x05, 0x04, 0x05, 0x00, 0x03, 0x06, 0x03, -0x06, 0x03, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D, -0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0D, 0x4B, 0x53, 0x54, 0x00, -0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xA0, 0x38, 0x01, -0xD4, 0x64, 0xDA, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x8B, 0xD7, 0xF0, 0x78, +0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, 0xE2, 0x4F, 0x29, 0xF0, +0xE4, 0x6B, 0xB7, 0xF8, 0xE5, 0x13, 0x18, 0x68, 0xE6, 0x62, 0x03, 0x78, 0xE7, 0x11, 0x4C, 0xE8, +0xE8, 0x2F, 0x70, 0x78, 0xE8, 0xE7, 0xF4, 0x68, 0xEA, 0x0F, 0x52, 0x78, 0xEA, 0xC7, 0xD6, 0x68, +0xEB, 0xEF, 0x34, 0x78, 0xEC, 0xA7, 0xB8, 0x68, 0xED, 0xCF, 0x16, 0x78, 0xEE, 0x87, 0x9A, 0x68, +0xF0, 0x35, 0x71, 0x78, 0x20, 0xA3, 0x60, 0x90, 0x21, 0x6E, 0x67, 0x90, 0x22, 0x83, 0x42, 0x90, +0x23, 0x4E, 0x49, 0x90, 0x01, 0x02, 0x03, 0x04, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, +0x01, 0x05, 0x01, 0x05, 0x01, 0x04, 0x06, 0x04, 0x06, 0x04, 0x00, 0x00, 0x77, 0x08, 0x00, 0x00, +0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, +0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x01, 0x11, 0x00, 0x00, +0x8C, 0xA0, 0x01, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54, +0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xA0, 0x38, 0x01, 0xD4, 0x64, 0xDA, 0x00, +0x00, 0x00, 0x00, /* Asia/Shanghai */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9584,13 +9602,11 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Asia/Vientiane */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x46, 0x50, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xBE, 0x7A, -0x01, 0xAF, 0x36, 0xA0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA2, 0x6A, 0x67, 0xC4, +0x01, 0x00, 0x00, 0x5E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x42, 0x4D, 0x54, +0x00, 0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xBE, 0x7A, 0x01, 0xAF, 0x36, +0xA0, 0x00, 0x00, 0x00, 0x00, /* Asia/Vladivostok */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -14391,7 +14407,7 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Europe/Minsk */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x22, 0xAA, 0x19, 0xAA, 0x38, +0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x22, 0xAA, 0x19, 0xAA, 0x38, 0xB5, 0xA4, 0x19, 0x60, 0xCA, 0x5E, 0x70, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x0A, 0x02, 0x60, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, @@ -14408,20 +14424,21 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { 0x40, 0x66, 0x15, 0x80, 0x41, 0x84, 0x2B, 0x00, 0x42, 0x45, 0xF7, 0x80, 0x43, 0x64, 0x0D, 0x00, 0x44, 0x25, 0xD9, 0x80, 0x45, 0x43, 0xEF, 0x00, 0x46, 0x05, 0xBB, 0x80, 0x47, 0x23, 0xD1, 0x00, 0x47, 0xEE, 0xD8, 0x00, 0x49, 0x03, 0xB3, 0x00, 0x49, 0xCE, 0xBA, 0x00, 0x4A, 0xE3, 0x95, 0x00, -0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, 0x01, 0x02, 0x05, 0x03, -0x04, 0x03, 0x04, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x02, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, +0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, 0x54, 0x4C, 0x1D, 0x60, +0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, +0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x02, 0x09, 0x0A, 0x09, 0x0A, 0x09, +0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x0B, -0x00, 0x00, 0x19, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, -0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, -0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x4D, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, -0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x46, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xDB, 0x92, 0xF0, 0x01, 0x3C, 0xB8, 0xBA, 0x00, 0x00, 0x00, 0x00, +0x0A, 0x09, 0x0A, 0x0B, 0x07, 0x00, 0x00, 0x19, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, +0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, +0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, +0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x4D, 0x4D, 0x54, +0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, +0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x46, 0x45, 0x54, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0x92, 0xF0, 0x01, 0x3C, 0xB8, 0xBA, 0x00, +0x00, 0x00, 0x00, /* Europe/Monaco */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16228,12 +16245,12 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Indian/Antananarivo */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x91, 0xF3, 0xCD, 0xF4, -0xE2, 0x33, 0xC0, 0xC0, 0xE2, 0xAB, 0xB9, 0x40, 0x01, 0x02, 0x03, 0x00, 0x00, 0x2C, 0x8C, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x08, 0x00, 0x00, 0x2A, -0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x76, 0xED, 0x01, 0x5B, 0x29, 0xB2, -0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x6C, 0x76, 0xED, 0x01, 0x5B, 0x29, 0xB2, 0x00, 0x00, 0x00, 0x00, /* Indian/Chagos */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16260,11 +16277,13 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Indian/Comoro */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD1, 0xF0, -0x01, 0x00, 0x00, 0x28, 0x90, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x80, 0x72, 0x01, 0x54, 0xAD, -0x8A, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x77, 0x80, 0x72, 0x01, 0x54, 0xAD, 0x8A, 0x00, 0x00, 0x00, 0x00, /* Indian/Kerguelen */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16302,11 +16321,13 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Indian/Mayotte */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x59, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD0, 0x18, -0x01, 0x00, 0x00, 0x2A, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0xD2, 0xC2, 0x01, 0x57, 0xAD, -0xC5, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x75, 0xD2, 0xC2, 0x01, 0x57, 0xAD, 0xC5, 0x00, 0x00, 0x00, 0x00, /* Indian/Reunion */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16966,6 +16987,16 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { 0x00, 0x00, 0x00, 0x51, 0x13, 0x35, 0x02, 0x1D, 0x54, 0xBA, 0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, +/* Pacific/Bougainville */ +0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xCC, 0x43, 0x36, 0x60, +0xD2, 0x2B, 0x6C, 0xF0, 0x54, 0x9E, 0xD7, 0x80, 0x01, 0x00, 0x02, 0x00, 0x00, 0x8C, 0xA0, 0x00, +0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x08, 0x50, 0x47, 0x54, +0x00, 0x4A, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x7F, 0xD7, 0xDD, 0x02, 0x00, 0x08, 0xBA, 0x00, 0x00, 0x00, 0x0C, 0x42, 0x6F, 0x75, 0x67, 0x61, +0x69, 0x6E, 0x76, 0x69, 0x6C, 0x6C, 0x65, + /* Pacific/Chatham */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, @@ -17118,19 +17149,19 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { 0x36, 0x3B, 0x17, 0xE0, 0x36, 0xD7, 0xFA, 0x60, 0x38, 0x24, 0x34, 0x60, 0x38, 0xB7, 0xDC, 0x60, 0x4B, 0x11, 0x2C, 0xE0, 0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xC2, 0xEA, 0x60, 0x4D, 0x72, 0x41, 0xE0, 0x4E, 0xA2, 0xCC, 0x60, 0x4F, 0x1A, 0xC4, 0xE0, 0x50, 0x82, 0xAE, 0x60, 0x50, 0xFA, 0xA6, 0xE0, -0x52, 0x6B, 0xCA, 0xE0, 0x52, 0xDA, 0x7A, 0xD0, 0x54, 0x4B, 0xAC, 0xE0, 0x54, 0xBA, 0x5C, 0xD0, -0x56, 0x2B, 0x8E, 0xE0, 0x56, 0xA3, 0x79, 0x50, 0x58, 0x0B, 0x70, 0xE0, 0x58, 0x83, 0x5B, 0x50, -0x59, 0xEB, 0x52, 0xE0, 0x5A, 0x63, 0x3D, 0x50, 0x5B, 0xCB, 0x34, 0xE0, 0x5C, 0x43, 0x1F, 0x50, -0x5D, 0xB4, 0x51, 0x60, 0x5E, 0x23, 0x01, 0x50, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x0C, 0x1D, 0xD0, -0x61, 0x74, 0x15, 0x60, 0x61, 0xEB, 0xFF, 0xD0, 0x63, 0x53, 0xF7, 0x60, 0x63, 0xCB, 0xE1, 0xD0, -0x65, 0x33, 0xD9, 0x60, 0x65, 0xAB, 0xC3, 0xD0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0x8B, 0xA5, 0xD0, -0x68, 0xFC, 0xD7, 0xE0, 0x69, 0x6B, 0x87, 0xD0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0x54, 0xA4, 0x50, -0x6C, 0xBC, 0x9B, 0xE0, 0x6D, 0x34, 0x86, 0x50, 0x6E, 0x9C, 0x7D, 0xE0, 0x6F, 0x14, 0x68, 0x50, -0x70, 0x7C, 0x5F, 0xE0, 0x70, 0xF4, 0x4A, 0x50, 0x72, 0x65, 0x7C, 0x60, 0x72, 0xD4, 0x2C, 0x50, -0x74, 0x45, 0x5E, 0x60, 0x74, 0xB4, 0x0E, 0x50, 0x76, 0x25, 0x40, 0x60, 0x76, 0x9D, 0x2A, 0xD0, -0x78, 0x05, 0x22, 0x60, 0x78, 0x7D, 0x0C, 0xD0, 0x79, 0xE5, 0x04, 0x60, 0x7A, 0x5C, 0xEE, 0xD0, -0x7B, 0xC4, 0xE6, 0x60, 0x7C, 0x3C, 0xD0, 0xD0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x1C, 0xB2, 0xD0, -0x7F, 0x8D, 0xE4, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x52, 0x6B, 0xCA, 0xE0, 0x52, 0xDA, 0x7A, 0xD0, 0x54, 0x54, 0xE7, 0x60, 0x54, 0xBA, 0x6A, 0xE0, +0x56, 0x34, 0xC9, 0x60, 0x56, 0xA3, 0x87, 0x60, 0x58, 0x1D, 0xE5, 0xE0, 0x58, 0x83, 0x69, 0x60, +0x59, 0xFD, 0xC7, 0xE0, 0x5A, 0x63, 0x4B, 0x60, 0x5B, 0xDD, 0xA9, 0xE0, 0x5C, 0x43, 0x2D, 0x60, +0x5D, 0xBD, 0x8B, 0xE0, 0x5E, 0x23, 0x0F, 0x60, 0x5F, 0x9D, 0x6D, 0xE0, 0x60, 0x0C, 0x2B, 0xE0, +0x61, 0x86, 0x8A, 0x60, 0x61, 0xEC, 0x0D, 0xE0, 0x63, 0x66, 0x6C, 0x60, 0x63, 0xCB, 0xEF, 0xE0, +0x65, 0x46, 0x4E, 0x60, 0x65, 0xAB, 0xD1, 0xE0, 0x67, 0x26, 0x30, 0x60, 0x67, 0x8B, 0xB3, 0xE0, +0x69, 0x06, 0x12, 0x60, 0x69, 0x6B, 0x95, 0xE0, 0x6A, 0xE5, 0xF4, 0x60, 0x6B, 0x54, 0xB2, 0x60, +0x6C, 0xCF, 0x10, 0xE0, 0x6D, 0x34, 0x94, 0x60, 0x6E, 0xAE, 0xF2, 0xE0, 0x6F, 0x14, 0x76, 0x60, +0x70, 0x8E, 0xD4, 0xE0, 0x70, 0xF4, 0x58, 0x60, 0x72, 0x6E, 0xB6, 0xE0, 0x72, 0xD4, 0x3A, 0x60, +0x74, 0x4E, 0x98, 0xE0, 0x74, 0xB4, 0x1C, 0x60, 0x76, 0x37, 0xB5, 0x60, 0x76, 0x9D, 0x38, 0xE0, +0x78, 0x17, 0x97, 0x60, 0x78, 0x7D, 0x1A, 0xE0, 0x79, 0xF7, 0x79, 0x60, 0x7A, 0x5C, 0xFC, 0xE0, +0x7B, 0xD7, 0x5B, 0x60, 0x7C, 0x3C, 0xDE, 0xE0, 0x7D, 0xB7, 0x3D, 0x60, 0x7E, 0x1C, 0xC0, 0xE0, +0x7F, 0x97, 0x1F, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, @@ -17338,7 +17369,8 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x50, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7A, 0xD5, 0x50, 0x01, 0xF3, 0x37, 0x7A, -0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, +0x6E, 0x73, /* Pacific/Rarotonga */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -17673,17 +17705,20 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { /* ROK */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, -0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, 0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80, -0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, 0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70, -0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x02, 0x03, 0x05, 0x04, 0x05, 0x00, 0x03, 0x06, 0x03, -0x06, 0x03, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D, -0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0D, 0x4B, 0x53, 0x54, 0x00, -0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x8B, 0xD7, 0xF0, 0x78, +0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, 0xE2, 0x4F, 0x29, 0xF0, +0xE4, 0x6B, 0xB7, 0xF8, 0xE5, 0x13, 0x18, 0x68, 0xE6, 0x62, 0x03, 0x78, 0xE7, 0x11, 0x4C, 0xE8, +0xE8, 0x2F, 0x70, 0x78, 0xE8, 0xE7, 0xF4, 0x68, 0xEA, 0x0F, 0x52, 0x78, 0xEA, 0xC7, 0xD6, 0x68, +0xEB, 0xEF, 0x34, 0x78, 0xEC, 0xA7, 0xB8, 0x68, 0xED, 0xCF, 0x16, 0x78, 0xEE, 0x87, 0x9A, 0x68, +0xF0, 0x35, 0x71, 0x78, 0x20, 0xA3, 0x60, 0x90, 0x21, 0x6E, 0x67, 0x90, 0x22, 0x83, 0x42, 0x90, +0x23, 0x4E, 0x49, 0x90, 0x01, 0x02, 0x03, 0x04, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, +0x01, 0x05, 0x01, 0x05, 0x01, 0x04, 0x06, 0x04, 0x06, 0x04, 0x00, 0x00, 0x77, 0x08, 0x00, 0x00, +0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, +0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x01, 0x11, 0x00, 0x00, +0x8C, 0xA0, 0x01, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54, +0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, +0x00, 0x00, 0x00, /* Singapore */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -18532,4 +18567,4 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = { 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, }; -const timelib_tzdb timezonedb_builtin = { "2014.8", 582, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2014.10", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 39b25d9cb5..5b62b540b7 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -326,7 +326,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_offset_get, 0, 0, 2) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_method_offset_get, 0, 0, 1) - ZEND_ARG_INFO(0, datetime) + ZEND_ARG_INFO(0, object) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_transitions_get, 0, 0, 1) @@ -3823,7 +3823,7 @@ PHP_FUNCTION(timezone_name_from_abbr) } /* }}} */ -/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTime object) +/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTimeInterface object) Returns the timezone offset. */ PHP_FUNCTION(timezone_offset_get) @@ -3833,13 +3833,13 @@ PHP_FUNCTION(timezone_offset_get) php_date_obj *dateobj; timelib_time_offset *offset; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_date) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) { RETURN_FALSE; } tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC); DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); + DATE_CHECK_INITIALIZED(dateobj->time, DateTimeInterface); switch (tzobj->type) { case TIMELIB_ZONETYPE_ID: diff --git a/ext/date/tests/68062.phpt b/ext/date/tests/68062.phpt new file mode 100644 index 0000000000..ce2105abae --- /dev/null +++ b/ext/date/tests/68062.phpt @@ -0,0 +1,13 @@ +--TEST-- +DateTimeZone::getOffset() accepts a DateTimeInterface object +--FILE-- +<?php + +$tz = new DateTimeZone('Europe/London'); +$dt = new DateTimeImmutable('2014-09-20', $tz); + +echo $tz->getOffset($dt); +echo $tz->getOffset(1); +--EXPECTF-- +3600 +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s diff --git a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt index a86d5e10bb..ecd99d5bc3 100644 --- a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt +++ b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt @@ -112,141 +112,141 @@ fclose( $file_handle ); -- int 0 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 1 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 12345 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int -12345 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- float 10.5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- float -10.5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- float .5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- empty array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- int indexed array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- associative array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- nested arrays -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- uppercase NULL -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase null -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase true -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- lowercase false -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase TRUE -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase FALSE -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- empty string DQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- empty string SQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- string DQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- string SQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- mixed case string -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- heredoc -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- instance of classWithToString -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d bool(false) -- instance of classWithoutToString -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d bool(false) -- undefined var -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- unset var -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- resource -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, resource given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d bool(false) ===DONE=== diff --git a/ext/date/tests/timezone_offset_get_error.phpt b/ext/date/tests/timezone_offset_get_error.phpt index b8ca2c1c15..c9fa25ce97 100644 --- a/ext/date/tests/timezone_offset_get_error.phpt +++ b/ext/date/tests/timezone_offset_get_error.phpt @@ -73,12 +73,12 @@ bool(false) -- Testing timezone_offset_get() function with an invalid values for $datetime argument -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d bool(false) -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) ===DONE=== diff --git a/ext/date/tests/timezone_offset_get_variation2.phpt b/ext/date/tests/timezone_offset_get_variation2.phpt index 93311f3a6b..c83b697498 100644 --- a/ext/date/tests/timezone_offset_get_variation2.phpt +++ b/ext/date/tests/timezone_offset_get_variation2.phpt @@ -112,141 +112,141 @@ fclose( $file_handle ); -- int 0 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 1 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 12345 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int -12345 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- float 10.5 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d bool(false) -- float -10.5 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d bool(false) -- float .5 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d bool(false) -- empty array -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- int indexed array -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- associative array -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- nested arrays -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- uppercase NULL -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase null -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase true -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- lowercase false -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase TRUE -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase FALSE -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- empty string DQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- empty string SQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- string DQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- string SQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- mixed case string -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- heredoc -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- instance of classWithToString -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d bool(false) -- instance of classWithoutToString -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d bool(false) -- undefined var -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- unset var -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- resource -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, resource given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, resource given in %s on line %d bool(false) ===DONE=== diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 38907b4d94..637ebf9289 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2426,11 +2426,11 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel data_ptr += 8; break; case TAG_FMT_SINGLE: - memmove(data_ptr, &info_data->value.f, byte_count); + memmove(data_ptr, &info_value->f, 4); data_ptr += 4; break; case TAG_FMT_DOUBLE: - memmove(data_ptr, &info_data->value.d, byte_count); + memmove(data_ptr, &info_value->d, 8); data_ptr += 8; break; } diff --git a/ext/exif/tests/bug68113.jpg b/ext/exif/tests/bug68113.jpg Binary files differnew file mode 100755 index 0000000000..3ce7a620fb --- /dev/null +++ b/ext/exif/tests/bug68113.jpg diff --git a/ext/exif/tests/bug68113.phpt b/ext/exif/tests/bug68113.phpt new file mode 100644 index 0000000000..0fa4c4aca8 --- /dev/null +++ b/ext/exif/tests/bug68113.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #68113 (Heap corruption in exif_thumbnail()) +--SKIPIF-- +<?php +extension_loaded("exif") or die("skip need exif"); +?> +--FILE-- +<?php +var_dump(exif_thumbnail(__DIR__."/bug68113.jpg")); +?> +Done +--EXPECTF-- +Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2 + +Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2 +bool(false) +Done
\ No newline at end of file diff --git a/ext/ext_skel b/ext/ext_skel index 650dae1e57..cd545ecf39 100755 --- a/ext/ext_skel +++ b/ext/ext_skel @@ -156,12 +156,12 @@ if test "\$PHP_$EXTNAME" != "no"; then dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL, dnl [ - dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD) + dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/\$PHP_LIBDIR, ${EXTNAME}_SHARED_LIBADD) dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ]) dnl ],[ dnl AC_MSG_ERROR([wrong $extname lib version or lib not found]) dnl ],[ - dnl -L\$${EXTNAME}_DIR/lib -lm + dnl -L\$${EXTNAME}_DIR/\$PHP_LIBDIR -lm dnl ]) dnl dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD) diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch index a91a658397..14409852bf 100644 --- a/ext/fileinfo/libmagic.patch +++ b/ext/fileinfo/libmagic.patch @@ -1,6 +1,6 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c --- libmagic.orig/apprentice.c Thu Mar 21 18:45:14 2013 -+++ libmagic/apprentice.c Mon Apr 14 23:42:51 2014 ++++ libmagic/apprentice.c Mon Sep 29 10:53:07 2014 @@ -29,6 +29,8 @@ * apprentice - make one pass through /etc/magic, learning its secrets. */ @@ -479,6 +479,15 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c return NULL; } return map; +@@ -1233,7 +1269,7 @@ + * the sign extension must have happened. + */ + case FILE_BYTE: +- v = (char) v; ++ v = (signed char) v; + break; + case FILE_SHORT: + case FILE_BESHORT: @@ -1500,7 +1536,7 @@ if (me->cont_count == me->max_count) { struct magic *nm; @@ -833,7 +842,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c } diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c --- libmagic.orig/ascmagic.c Wed Oct 31 18:03:01 2012 -+++ libmagic/ascmagic.c Mon Apr 14 23:42:51 2014 ++++ libmagic/ascmagic.c Mon Mar 10 16:40:55 2014 @@ -139,7 +139,7 @@ /* malloc size is a conservative overestimate; could be improved, or at least realloced after conversion. */ @@ -872,7 +881,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c } diff -u libmagic.orig/cdf.c libmagic/cdf.c --- libmagic.orig/cdf.c Thu Mar 21 18:45:14 2013 -+++ libmagic/cdf.c Tue Jul 1 09:00:09 2014 ++++ libmagic/cdf.c Wed Aug 20 21:20:34 2014 @@ -43,7 +43,17 @@ #include <err.h> #endif @@ -955,7 +964,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c errno = EFTYPE; return (size_t)-1; } -@@ -796,7 +812,11 @@ +@@ -796,11 +812,15 @@ if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1) goto out; for (i = 0; i < sh.sh_properties; i++) { @@ -968,6 +977,11 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c q = (const uint8_t *)(const void *) ((const char *)(const void *)p + ofs - 2 * sizeof(uint32_t)); +- if (q > e) { ++ if (q < p || q > e) { + DPRINTF(("Ran of the end %p > %p\n", q, e)); + goto out; + } @@ -810,6 +830,10 @@ i, inp[i].pi_id, inp[i].pi_type, q - p, offs)); if (inp[i].pi_type & CDF_VECTOR) { @@ -1056,7 +1070,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c } else { diff -u libmagic.orig/cdf.h libmagic/cdf.h --- libmagic.orig/cdf.h Wed Oct 31 18:03:01 2012 -+++ libmagic/cdf.h Mon Apr 14 23:32:55 2014 ++++ libmagic/cdf.h Mon Dec 2 15:25:29 2013 @@ -35,10 +35,12 @@ #ifndef _H_CDF_ #define _H_CDF_ @@ -1099,7 +1113,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h void cdf_unpack_header(cdf_header_t *, char *); diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c --- libmagic.orig/cdf_time.c Wed Oct 31 18:03:01 2012 -+++ libmagic/cdf_time.c Mon Apr 14 23:32:55 2014 ++++ libmagic/cdf_time.c Mon Dec 2 15:25:29 2013 @@ -96,7 +96,7 @@ } @@ -1159,7 +1173,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c static const char *ref = "Sat Apr 23 01:30:00 1977"; diff -u libmagic.orig/compress.c libmagic/compress.c --- libmagic.orig/compress.c Sun Jan 6 21:35:43 2013 -+++ libmagic/compress.c Mon Apr 14 23:42:51 2014 ++++ libmagic/compress.c Mon Dec 2 15:25:29 2013 @@ -32,6 +32,7 @@ * uncompress(method, old, n, newch) - uncompress old into new, * using method, return sizeof new @@ -1322,7 +1336,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c +#endif /* if PHP_FILEINFO_UNCOMPRESS */ diff -u libmagic.orig/file.h libmagic/file.h --- libmagic.orig/file.h Mon Feb 18 16:40:59 2013 -+++ libmagic/file.h Mon Apr 14 23:42:51 2014 ++++ libmagic/file.h Mon Mar 10 16:40:55 2014 @@ -33,11 +33,9 @@ #ifndef __file_h__ #define __file_h__ @@ -1532,7 +1546,7 @@ diff -u libmagic.orig/file.h libmagic/file.h #endif /* __file_h__ */ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c --- libmagic.orig/fsmagic.c Thu Mar 21 18:45:14 2013 -+++ libmagic/fsmagic.c Mon Apr 14 23:42:51 2014 ++++ libmagic/fsmagic.c Mon Dec 2 15:25:29 2013 @@ -59,27 +59,21 @@ # define minor(dev) ((dev) & 0xff) #endif @@ -1899,7 +1913,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c } diff -u libmagic.orig/funcs.c libmagic/funcs.c --- libmagic.orig/funcs.c Wed Oct 31 18:03:01 2012 -+++ libmagic/funcs.c Mon Apr 14 23:42:51 2014 ++++ libmagic/funcs.c Mon Mar 10 16:40:55 2014 @@ -41,52 +41,42 @@ #if defined(HAVE_WCTYPE_H) #include <wctype.h> @@ -2193,7 +2207,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c + diff -u libmagic.orig/magic.c libmagic/magic.c --- libmagic.orig/magic.c Fri Jan 11 17:43:09 2013 -+++ libmagic/magic.c Mon Apr 14 23:42:51 2014 ++++ libmagic/magic.c Mon Dec 2 15:29:02 2013 @@ -25,11 +25,6 @@ * SUCH DAMAGE. */ @@ -2537,7 +2551,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c magic_error(struct magic_set *ms) diff -u libmagic.orig/magic.h libmagic/magic.h --- libmagic.orig/magic.h Thu Mar 21 18:52:42 2013 -+++ libmagic/magic.h Mon Apr 14 23:42:51 2014 ++++ libmagic/magic.h Mon Dec 2 15:25:29 2013 @@ -87,6 +87,7 @@ const char *magic_getpath(const char *, int); @@ -2556,14 +2570,14 @@ diff -u libmagic.orig/magic.h libmagic/magic.h diff -u libmagic.orig/print.c libmagic/print.c --- libmagic.orig/print.c Thu Mar 21 18:45:14 2013 -+++ libmagic/print.c Mon Apr 14 23:42:51 2014 -@@ -29,12 +29,17 @@ ++++ libmagic/print.c Mon Dec 2 15:29:02 2013 +@@ -28,13 +28,17 @@ + /* * print.c - debugging printout routines */ - +#define _GNU_SOURCE +#include "php.h" -+ + #include "file.h" +#include "cdf.h" @@ -2575,7 +2589,7 @@ diff -u libmagic.orig/print.c libmagic/print.c #include <string.h> #include <stdarg.h> #include <stdlib.h> -@@ -43,188 +48,28 @@ +@@ -43,188 +47,28 @@ #endif #include <time.h> @@ -2776,7 +2790,7 @@ diff -u libmagic.orig/print.c libmagic/print.c } protected const char * -@@ -235,7 +80,7 @@ +@@ -235,7 +79,7 @@ struct tm *tm; if (flags & FILE_T_WINDOWS) { @@ -2787,7 +2801,7 @@ diff -u libmagic.orig/print.c libmagic/print.c } diff -u libmagic.orig/readcdf.c libmagic/readcdf.c --- libmagic.orig/readcdf.c Wed Oct 31 18:03:01 2012 -+++ libmagic/readcdf.c Tue May 27 22:17:37 2014 ++++ libmagic/readcdf.c Thu Apr 24 19:54:40 2014 @@ -30,7 +30,11 @@ #endif @@ -2863,7 +2877,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c return -1; diff -u libmagic.orig/readelf.c libmagic/readelf.c --- libmagic.orig/readelf.c Thu Mar 21 18:45:14 2013 -+++ libmagic/readelf.c Mon Apr 14 23:42:51 2014 ++++ libmagic/readelf.c Sat Oct 25 11:50:05 2014 @@ -48,8 +48,8 @@ private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t, off_t, int *, int); @@ -2956,7 +2970,21 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badread(ms); return -1; } -@@ -852,24 +867,12 @@ +@@ -357,6 +372,13 @@ + uint32_t namesz, descsz; + unsigned char *nbuf = CAST(unsigned char *, vbuf); + ++ if (xnh_sizeof + offset > size) { ++ /* ++ * We're out of note headers. ++ */ ++ return xnh_sizeof + offset; ++ } ++ + (void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof); + offset += xnh_sizeof; + +@@ -852,24 +874,12 @@ return 0; } @@ -2984,7 +3012,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badread(ms); return -1; } -@@ -894,14 +897,17 @@ +@@ -894,14 +904,17 @@ /* Things we can determine when we seek */ switch (xsh_type) { case SHT_NOTE: @@ -3007,7 +3035,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c return -1; } -@@ -910,25 +916,16 @@ +@@ -910,25 +923,16 @@ if (noff >= (off_t)xsh_size) break; noff = donote(ms, nbuf, (size_t)noff, @@ -3038,7 +3066,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badseek(ms); return -1; } -@@ -940,7 +937,7 @@ +@@ -940,7 +944,7 @@ MAX(sizeof cap32, sizeof cap64)]; if ((coff += xcap_sizeof) > (off_t)xsh_size) break; @@ -3047,7 +3075,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c (ssize_t)xcap_sizeof) { file_badread(ms); return -1; -@@ -966,13 +963,12 @@ +@@ -966,13 +970,12 @@ break; } } @@ -3063,7 +3091,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (file_printf(ms, ", %sstripped", stripped ? "" : "not ") == -1) return -1; if (cap_hw1) { -@@ -1051,7 +1047,7 @@ +@@ -1051,7 +1054,7 @@ const char *shared_libraries = ""; unsigned char nbuf[BUFSIZ]; ssize_t bufsize; @@ -3072,7 +3100,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (size != xph_sizeof) { if (file_printf(ms, ", corrupted program header size") == -1) -@@ -1060,8 +1056,13 @@ +@@ -1060,8 +1063,13 @@ } for ( ; num; num--) { @@ -3088,7 +3116,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c return -1; } -@@ -1099,9 +1100,12 @@ +@@ -1099,9 +1107,12 @@ * This is a PT_NOTE section; loop through all the notes * in the section. */ @@ -3104,7 +3132,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (bufsize == -1) { file_badread(ms); return -1; -@@ -1162,7 +1166,7 @@ +@@ -1162,7 +1173,7 @@ /* * If we cannot seek, it must be a pipe, socket or fifo. */ @@ -3115,7 +3143,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (fstat(fd, &st) == -1) { diff -u libmagic.orig/readelf.h libmagic/readelf.h --- libmagic.orig/readelf.h Thu Mar 21 18:45:14 2013 -+++ libmagic/readelf.h Mon Apr 14 23:42:51 2014 ++++ libmagic/readelf.h Mon Dec 2 15:25:29 2013 @@ -44,9 +44,17 @@ typedef uint32_t Elf32_Word; typedef uint8_t Elf32_Char; @@ -3136,7 +3164,7 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h typedef uint8_t Elf64_Char; diff -u libmagic.orig/softmagic.c libmagic/softmagic.c --- libmagic.orig/softmagic.c Thu Mar 21 18:45:14 2013 -+++ libmagic/softmagic.c Tue Jul 1 09:00:09 2014 ++++ libmagic/softmagic.c Wed Aug 20 21:20:34 2014 @@ -41,6 +41,11 @@ #include <stdlib.h> #include <time.h> @@ -3149,6 +3177,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private int match(struct magic_set *, struct magic *, uint32_t, const unsigned char *, size_t, size_t, int, int, int, int, int *, int *, +@@ -53,7 +58,7 @@ + private int32_t moffset(struct magic_set *, struct magic *); + private void mdebug(uint32_t, const char *, size_t); + private int mcopy(struct magic_set *, union VALUETYPE *, int, int, +- const unsigned char *, uint32_t, size_t, size_t); ++ const unsigned char *, uint32_t, size_t, struct magic *); + private int mconvert(struct magic_set *, struct magic *, int); + private int print_sep(struct magic_set *, int); + private int handle_annotation(struct magic_set *, struct magic *); @@ -62,6 +67,8 @@ private void cvt_32(union VALUETYPE *, const struct magic *); private void cvt_64(union VALUETYPE *, const struct magic *); @@ -3308,9 +3345,72 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c while (len--) *ptr1++ = *ptr2++; *ptr1 = '\0'; -@@ -1145,9 +1138,6 @@ - "nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o, - nbytes, count); +@@ -1010,7 +1003,7 @@ + + private int + mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, +- const unsigned char *s, uint32_t offset, size_t nbytes, size_t linecnt) ++ const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m) + { + /* + * Note: FILE_SEARCH and FILE_REGEX do not actually copy +@@ -1030,15 +1023,24 @@ + const char *last; /* end of search region */ + const char *buf; /* start of search region */ + const char *end; +- size_t lines; ++ size_t lines, linecnt, bytecnt; ++ ++ linecnt = m->str_range; ++ bytecnt = linecnt * 80; + ++ if (bytecnt == 0) { ++ bytecnt = 8192; ++ } ++ if (bytecnt > nbytes) { ++ bytecnt = nbytes; ++ } + if (s == NULL) { + ms->search.s_len = 0; + ms->search.s = NULL; + return 0; + } + buf = RCAST(const char *, s) + offset; +- end = last = RCAST(const char *, s) + nbytes; ++ end = last = RCAST(const char *, s) + bytecnt; + /* mget() guarantees buf <= last */ + for (lines = linecnt, b = buf; lines && b < end && + ((b = CAST(const char *, +@@ -1051,7 +1053,7 @@ + b++; + } + if (lines) +- last = RCAST(const char *, s) + nbytes; ++ last = RCAST(const char *, s) + bytecnt; + + ms->search.s = buf; + ms->search.s_len = last - buf; +@@ -1125,7 +1127,6 @@ + int *need_separator, int *returnval) + { + uint32_t soffset, offset = ms->offset; +- uint32_t count = m->str_range; + int rv, oneed_separator; + char *sbuf, *rbuf; + union VALUETYPE *p = &ms->ms_value; +@@ -1137,17 +1138,13 @@ + } + + if (mcopy(ms, p, m->type, m->flag & INDIR, s, (uint32_t)(offset + o), +- (uint32_t)nbytes, count) == -1) ++ (uint32_t)nbytes, m) == -1) + return -1; + + if ((ms->flags & MAGIC_DEBUG) != 0) { + fprintf(stderr, "mget(type=%d, flag=%x, offset=%u, o=%zu, " +- "nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o, +- nbytes, count); ++ "nbytes=%zu)\n", m->type, m->flag, offset, o, nbytes); mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE)); -#ifndef COMPILE_ONLY - file_mdump(m); @@ -3318,7 +3418,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } if (m->flag & INDIR) { -@@ -1191,7 +1181,7 @@ +@@ -1191,7 +1188,7 @@ } switch (cvt_flip(m->in_type, flip)) { case FILE_BYTE: @@ -3327,7 +3427,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1226,7 +1216,7 @@ +@@ -1226,7 +1223,7 @@ offset = ~offset; break; case FILE_BESHORT: @@ -3336,7 +3436,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1278,7 +1268,7 @@ +@@ -1278,7 +1275,7 @@ offset = ~offset; break; case FILE_LESHORT: @@ -3345,7 +3445,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1330,7 +1320,7 @@ +@@ -1330,7 +1327,7 @@ offset = ~offset; break; case FILE_SHORT: @@ -3354,7 +3454,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1367,7 +1357,7 @@ +@@ -1367,7 +1364,7 @@ break; case FILE_BELONG: case FILE_BEID3: @@ -3363,7 +3463,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1438,7 +1428,7 @@ +@@ -1438,7 +1435,7 @@ break; case FILE_LELONG: case FILE_LEID3: @@ -3372,7 +3472,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1508,7 +1498,7 @@ +@@ -1508,7 +1505,7 @@ offset = ~offset; break; case FILE_MELONG: @@ -3381,7 +3481,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1578,7 +1568,7 @@ +@@ -1578,7 +1575,7 @@ offset = ~offset; break; case FILE_LONG: @@ -3390,7 +3490,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1644,23 +1634,20 @@ +@@ -1637,30 +1634,27 @@ + if ((ms->flags & MAGIC_DEBUG) != 0) + fprintf(stderr, "indirect +offs=%u\n", offset); + } +- if (mcopy(ms, p, m->type, 0, s, offset, nbytes, count) == -1) ++ if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1) + return -1; + ms->offset = offset; + if ((ms->flags & MAGIC_DEBUG) != 0) { mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE)); @@ -3416,7 +3524,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; break; -@@ -1679,38 +1666,40 @@ +@@ -1679,38 +1673,40 @@ case FILE_FLOAT: case FILE_BEFLOAT: case FILE_LEFLOAT: @@ -3463,7 +3571,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c if ((ms->flags & MAGIC_DEBUG) != 0) fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv); rbuf = ms->o.buf; -@@ -1718,16 +1707,26 @@ +@@ -1718,16 +1714,26 @@ ms->offset = soffset; if (rv == 1) { if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && @@ -3494,7 +3602,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; sbuf = m->value.s; if (*sbuf == '^') { -@@ -1837,6 +1836,42 @@ +@@ -1837,6 +1843,42 @@ return file_strncmp(a, b, len, flags); } @@ -3537,7 +3645,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private int magiccheck(struct magic_set *ms, struct magic *m) { -@@ -1996,69 +2031,157 @@ +@@ -1996,69 +2038,157 @@ break; } case FILE_REGEX: { @@ -3608,7 +3716,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c + zval *retval; + zval *subpats; + char *haystack; -+ ++ + MAKE_STD_ZVAL(retval); + ALLOC_INIT_ZVAL(subpats); + diff --git a/ext/fileinfo/libmagic/readelf.c b/ext/fileinfo/libmagic/readelf.c index 1c3845fc6b..bb6f70fb8b 100644 --- a/ext/fileinfo/libmagic/readelf.c +++ b/ext/fileinfo/libmagic/readelf.c @@ -372,6 +372,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, uint32_t namesz, descsz; unsigned char *nbuf = CAST(unsigned char *, vbuf); + if (xnh_sizeof + offset > size) { + /* + * We're out of note headers. + */ + return xnh_sizeof + offset; + } + (void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof); offset += xnh_sizeof; diff --git a/ext/gd/gd.c b/ext/gd/gd.c index cbc7219e37..f86dad58dc 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -5110,11 +5110,23 @@ PHP_FUNCTION(imagescale) return; } method = tmp_m; - new_width = tmp_w; - new_height = tmp_h; ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); + if (tmp_h < 0) { + /* preserve ratio */ + long src_x, src_y; + + src_x = gdImageSX(im); + src_y = gdImageSY(im); + if (src_x) { + tmp_h = tmp_w * src_y / src_x; + } + } + + new_width = tmp_w; + new_height = tmp_h; + if (gdImageSetInterpolationMethod(im, method)) { im_scaled = gdImageScale(im, new_width, new_height); } diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo Binary files differnew file mode 100644 index 0000000000..1aaba7b27b --- /dev/null +++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po new file mode 100644 index 0000000000..d2496d78fc --- /dev/null +++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: bugs.php.net/66265\n" +"POT-Creation-Date: 2014-11-20 16:33+0100\n" +"PO-Revision-Date: 2014-11-20 16:40+0100\n" +"Last-Translator: <ab@php.net>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.10\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: de_DE\n" + +msgid "hello" +msgstr "hallo" diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo Binary files differnew file mode 100644 index 0000000000..79d02c1732 --- /dev/null +++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po new file mode 100644 index 0000000000..670d7ddadf --- /dev/null +++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: bugs.php.net/66265\n" +"POT-Creation-Date: 2014-11-20 16:33+0100\n" +"PO-Revision-Date: 2014-11-20 16:40+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.10\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: en_US\n" + +msgid "hello" +msgstr "hello" diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo Binary files differnew file mode 100644 index 0000000000..c2f3cdd6b7 --- /dev/null +++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po new file mode 100644 index 0000000000..c2f708c526 --- /dev/null +++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: bugs.php.net/66265\n" +"POT-Creation-Date: 2014-11-20 16:33+0100\n" +"PO-Revision-Date: 2014-11-20 16:59+0100\n" +"Last-Translator: <ab@php.net>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.10\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: fr_FR\n" + +msgid "hello" +msgstr "salut" diff --git a/ext/gettext/tests/bug66267.phpt b/ext/gettext/tests/bug66267.phpt new file mode 100644 index 0000000000..26963acb7e --- /dev/null +++ b/ext/gettext/tests/bug66267.phpt @@ -0,0 +1,55 @@ +--TEST-- +#66265: gettext doesn't switch locales within the same script +--SKIPIF-- +<?php +if (!extension_loaded("gettext")) { + die("skip\n"); +} +if (PHP_ZTS) { + /* this is supposed to fail on the TS build at least on Windows, + should be even XFAIL till it's fixed there */ + die("skip NTS only"); +} +if (substr(PHP_OS, 0, 3) != 'WIN') { + $loc = ["de_DE", "fr_FR", "en_US"]; + foreach($loc as $l) { + if (!setlocale(LC_ALL, $l)) { + die("SKIP '$l' locale not supported."); + } + } +} +?> +--FILE-- +<?php + +$domain = 'domain'; + +$loc = ["de_DE", "fr_FR", "en_US"]; + +foreach ($loc as $l) { + putenv("LC_ALL=$l"); + + $path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . "66265"); + bindtextdomain($domain, $path); + bind_textdomain_codeset($domain, "UTF-8"); + textdomain($domain); + + echo 'LC_ALL=', getenv('LC_ALL'), "\n"; + echo 'hello=', _('hello'), "\n"; + echo "\n"; +} + +?> +==DONE== +--EXPECTF-- +LC_ALL=de_DE +hello=hallo + +LC_ALL=fr_FR +hello=salut + +LC_ALL=en_US +hello=hello + +==DONE== + diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index f51bd8c59c..b1553fa16f 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -324,30 +324,6 @@ static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC); # define MAX_BASE 36 #endif -/* {{{ gmp_emalloc - */ -static void *gmp_emalloc(size_t size) -{ - return emalloc(size); -} -/* }}} */ - -/* {{{ gmp_erealloc - */ -static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size) -{ - return erealloc(ptr, new_size); -} -/* }}} */ - -/* {{{ gmp_efree - */ -static void gmp_efree(void *ptr, size_t size) -{ - efree(ptr); -} -/* }}} */ - /* {{{ ZEND_GINIT_FUNCTION */ static ZEND_GINIT_FUNCTION(gmp) @@ -369,8 +345,6 @@ ZEND_MODULE_STARTUP_D(gmp) #endif REGISTER_STRING_CONSTANT("GMP_VERSION", (char *)gmp_version, CONST_CS | CONST_PERSISTENT); - mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree); - return SUCCESS; } /* }}} */ diff --git a/ext/intl/tests/bug67052-win32.phpt b/ext/intl/tests/bug67052-win32.phpt new file mode 100644 index 0000000000..5bc6497bea --- /dev/null +++ b/ext/intl/tests/bug67052-win32.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die("skip Valid only on Windows"); +} +?> +--FILE-- +<?php + +function ut_main() +{ + setlocale(LC_ALL, 'de-de'); + $fmt = new NumberFormatter( 'sl_SI.UTF-8', NumberFormatter::DECIMAL); + $num = "1.234.567,891"; + $res_str = $fmt->parse($num)."\n"; + $res_str .= setlocale(LC_NUMERIC, 0); + return $res_str; +} + +include_once( 'ut_common.inc' ); +ut_run(); + +?> +--EXPECT-- +1234567,891 +de-de + diff --git a/ext/intl/tests/bug67052.phpt b/ext/intl/tests/bug67052.phpt index c8363b9c7a..8edd65de71 100644 --- a/ext/intl/tests/bug67052.phpt +++ b/ext/intl/tests/bug67052.phpt @@ -2,6 +2,11 @@ Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip Valid only on non Windows"); +} +?> --FILE-- <?php diff --git a/ext/intl/tests/collator_create3.phpt b/ext/intl/tests/collator_create3.phpt index c602e794cd..5041e635fa 100644 --- a/ext/intl/tests/collator_create3.phpt +++ b/ext/intl/tests/collator_create3.phpt @@ -1,8 +1,9 @@ --TEST-- -create() icu >= 53.1 +create() icu >= 53.1 && icu < 54.1 --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> <?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php diff --git a/ext/intl/tests/collator_create4.phpt b/ext/intl/tests/collator_create4.phpt new file mode 100644 index 0000000000..2c22e6a442 --- /dev/null +++ b/ext/intl/tests/collator_create4.phpt @@ -0,0 +1,79 @@ +--TEST-- +create() icu >= 53.1 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php + +/* + * Try creating collator with different locales + * with Procedural and Object methods. + */ + +function ut_main() +{ + $res_str = ''; + + $locales = array( + 'EN-US-ODESSA', + 'UK_UA_ODESSA', + 'uk-ua_CALIFORNIA@currency=;currency=GRN', + '', + 'root', + 'uk@currency=EURO', + '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' + ); + + foreach( $locales as $locale ) + { + // Create Collator with the current locale. + $coll = ut_coll_create( $locale ); + if( !is_object($coll) ) + { + $res_str .= "Error creating collator with '$locale' locale: " . + intl_get_error_message() . "\n"; + continue; + } + + // Get the requested, valid and actual locales. + $vloc = ut_coll_get_locale( $coll, Locale::VALID_LOCALE ); + $aloc = ut_coll_get_locale( $coll, Locale::ACTUAL_LOCALE ); + + // Show them. + $res_str .= "Locale: '$locale'\n" . + " ULOC_REQUESTED_LOCALE = '$locale'\n" . + " ULOC_VALID_LOCALE = '$vloc'\n" . + " ULOC_ACTUAL_LOCALE = '$aloc'\n"; + } + + return $res_str; +} + +include_once( 'ut_common.inc' ); +ut_run(); + +?> +--EXPECTF-- +Locale: 'EN-US-ODESSA' + ULOC_REQUESTED_LOCALE = 'EN-US-ODESSA' + ULOC_VALID_LOCALE = 'en_US' + ULOC_ACTUAL_LOCALE = 'root' +Locale: 'UK_UA_ODESSA' + ULOC_REQUESTED_LOCALE = 'UK_UA_ODESSA' + ULOC_VALID_LOCALE = 'uk' + ULOC_ACTUAL_LOCALE = 'uk' +Error creating collator with 'uk-ua_CALIFORNIA@currency=;currency=GRN' locale: collator_create: unable to open ICU collator: U_ILLEGAL_ARGUMENT_ERROR +Locale: '' + ULOC_REQUESTED_LOCALE = '' + ULOC_VALID_LOCALE = '%s' + ULOC_ACTUAL_LOCALE = '%s' +Locale: 'root' + ULOC_REQUESTED_LOCALE = 'root' + ULOC_VALID_LOCALE = 'root' + ULOC_ACTUAL_LOCALE = 'root' +Locale: 'uk@currency=EURO' + ULOC_REQUESTED_LOCALE = 'uk@currency=EURO' + ULOC_VALID_LOCALE = 'uk' + ULOC_ACTUAL_LOCALE = 'uk' +Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR diff --git a/ext/intl/tests/collator_get_sort_key_variant3.phpt b/ext/intl/tests/collator_get_sort_key_variant3.phpt index cc2a23b2b8..f4cb88e3e7 100644 --- a/ext/intl/tests/collator_get_sort_key_variant3.phpt +++ b/ext/intl/tests/collator_get_sort_key_variant3.phpt @@ -1,8 +1,9 @@ --TEST-- -collator_get_sort_key() +collator_get_sort_key() icu >= 53.1 && icu < 54.1 --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> <?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php diff --git a/ext/intl/tests/collator_get_sort_key_variant4.phpt b/ext/intl/tests/collator_get_sort_key_variant4.phpt new file mode 100644 index 0000000000..2c86f21111 --- /dev/null +++ b/ext/intl/tests/collator_get_sort_key_variant4.phpt @@ -0,0 +1,98 @@ +--TEST-- +collator_get_sort_key() icu >= 54.1 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php + +/* + * Get sort keys using various locales + */ +function sort_arrays( $locale, $data ) +{ + $res_str = ''; + + $coll = ut_coll_create( $locale ); + + foreach($data as $value) { + $res_val = ut_coll_get_sort_key( $coll, $value ); + $res_str .= "source: ".$value."\n". + "key: ".bin2hex($res_val)."\n"; + } + + return $res_str; +} + + +function ut_main() +{ + $res_str = ''; + + // Regular strings keys + $test_params = array( + 'abc', 'abd', 'aaa', + 'аа', 'а', 'z', + '', null , '3', + 'y' , 'i' , 'k' + ); + + $res_str .= sort_arrays( 'en_US', $test_params ); + + // Sort a non-ASCII array using ru_RU locale. + $test_params = array( + 'абг', 'абв', 'жжж', 'эюя' + ); + + $res_str .= sort_arrays( 'ru_RU', $test_params ); + + // Sort an array using Lithuanian locale. + $res_str .= sort_arrays( 'lt_LT', $test_params ); + + return $res_str . "\n"; +} + +include_once( 'ut_common.inc' ); +ut_run(); +?> +--EXPECT-- +source: abc +key: 292b2d01070107 +source: abd +key: 292b2f01070107 +source: aaa +key: 29292901070107 +source: аа +key: 5e060601060106 +source: а +key: 5e0601050105 +source: z +key: 5b01050105 +source: +key: 0101 +source: +key: 0101 +source: 3 +key: 1a01050105 +source: y +key: 5901050105 +source: i +key: 3901050105 +source: k +key: 3d01050105 +source: абг +key: 2806101401070107 +source: абв +key: 2806101201070107 +source: жжж +key: 2830303001070107 +source: эюя +key: 28ccd0d401070107 +source: абг +key: 5e06101401070107 +source: абв +key: 5e06101201070107 +source: жжж +key: 5e30303001070107 +source: эюя +key: 5eccd0d401070107 diff --git a/ext/intl/tests/dateformat_calendars_variant2.phpt b/ext/intl/tests/dateformat_calendars_variant2.phpt index 61cdea8408..b3b1701c55 100644 --- a/ext/intl/tests/dateformat_calendars_variant2.phpt +++ b/ext/intl/tests/dateformat_calendars_variant2.phpt @@ -6,6 +6,7 @@ date.timezone=Atlantic/Azores <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> <?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_calendars_variant3.phpt b/ext/intl/tests/dateformat_calendars_variant3.phpt new file mode 100644 index 0000000000..36a67e6f04 --- /dev/null +++ b/ext/intl/tests/dateformat_calendars_variant3.phpt @@ -0,0 +1,45 @@ +--TEST-- +IntlDateFormatter, calendars and time zone +--INI-- +date.timezone=Atlantic/Azores +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); + +$fmt1 = new IntlDateFormatter('en_US', + IntlDateFormatter::FULL, + IntlDateFormatter::FULL, + 'GMT+05:12', + IntlDateFormatter::TRADITIONAL); +$fmt2 = new IntlDateFormatter('en_US', + IntlDateFormatter::FULL, + IntlDateFormatter::FULL, + 'GMT+05:12', + IntlDateFormatter::GREGORIAN); +$fmt3 = new IntlDateFormatter('en_US@calendar=hebrew', + IntlDateFormatter::FULL, + IntlDateFormatter::FULL, + 'GMT+05:12', + IntlDateFormatter::TRADITIONAL); +var_dump($fmt1->format(strtotime('2012-01-01 00:00:00 +0000'))); +var_dump($fmt2->format(strtotime('2012-01-01 00:00:00 +0000'))); +var_dump($fmt3->format(strtotime('2012-01-01 00:00:00 +0000'))); + +new IntlDateFormatter('en_US@calendar=hebrew', + IntlDateFormatter::FULL, + IntlDateFormatter::FULL, + 'GMT+05:12', + -1); +?> +==DONE== +--EXPECTF-- +string(47) "Sunday, January 1, 2012 at 5:12:00 AM GMT+05:12" +string(47) "Sunday, January 1, 2012 at 5:12:00 AM GMT+05:12" +string(44) "Sunday, 6 Tevet 5772 at 5:12:00 AM GMT+05:12" + +Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN. Alternatively, it can be an IntlCalendar object in %sdateformat_calendars_variant%d.php on line %d +==DONE== diff --git a/ext/intl/tests/dateformat_create_cal_arg_variant2.phpt b/ext/intl/tests/dateformat_create_cal_arg_variant2.phpt index 70b862017b..77ec53047b 100644 --- a/ext/intl/tests/dateformat_create_cal_arg_variant2.phpt +++ b/ext/intl/tests/dateformat_create_cal_arg_variant2.phpt @@ -3,7 +3,7 @@ IntlDateFormatter: several forms of the calendar arg --SKIPIF-- <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> -<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt b/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt new file mode 100644 index 0000000000..1beff145de --- /dev/null +++ b/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt @@ -0,0 +1,54 @@ +--TEST-- +IntlDateFormatter: several forms of the calendar arg +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic'); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +//override calendar's timezone +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal); +echo $df->format($ts), "\n"; + +//default calendar is gregorian +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0); +echo $df->format($ts), "\n"; + +//try now with traditional +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +//the timezone can be overridden when not specifying a calendar +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0); +echo $df->format($ts), "\n"; + +?> +==DONE== +--EXPECTF-- +domingo%S 1 de enero de 2012, 0:00:00 (GMT) +domingo%S 8 de Safar de 1433, 0:00:00 (GMT) +domingo%S 1 de enero de 2012, 1:00:00 (Hora estándar de Europa central) +sábado%S 31 de diciembre de 2011 d. C., 23:00:00 (Hora estándar %Sde las Azores) +sábado%S 7 de Safar de 1433 AH, 23:00:00 (Hora estándar %Sde las Azores) +domingo%S 8 de Safar de 1433 AH, 0:00:00 (GMT) +domingo%S 1 de enero de 2012, 0:00:00 (GMT) +==DONE== diff --git a/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt b/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt new file mode 100644 index 0000000000..4086e4558a --- /dev/null +++ b/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt @@ -0,0 +1,53 @@ +--TEST-- +IntlDateFormatter: several forms of the calendar arg +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic'); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +//override calendar's timezone +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal); +echo $df->format($ts), "\n"; + +//default calendar is gregorian +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0); +echo $df->format($ts), "\n"; + +//try now with traditional +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +//the timezone can be overridden when not specifying a calendar +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0); +echo $df->format($ts), "\n"; + +?> +==DONE== +--EXPECTF-- +domingo%S 1 de enero de 2012, 0:00:00 (GMT) +domingo%S 8 de Safar de 1433, 0:00:00 (GMT) +domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central) +sábado, 31 de diciembre de 2011 d. C., 23:00:00 (hora estándar de las Azores) +sábado, 7 de Safar de 1433 AH, 23:00:00 (hora estándar de las Azores) +domingo%S 8 de Safar de 1433 AH, 0:00:00 (GMT) +domingo%S 1 de enero de 2012, 0:00:00 (GMT) +==DONE== diff --git a/ext/intl/tests/dateformat_formatObject_calendar_variant2.phpt b/ext/intl/tests/dateformat_formatObject_calendar_variant2.phpt index 1ec1fa669a..d59c635a7d 100644 --- a/ext/intl/tests/dateformat_formatObject_calendar_variant2.phpt +++ b/ext/intl/tests/dateformat_formatObject_calendar_variant2.phpt @@ -3,7 +3,7 @@ IntlDateFormatter::formatObject(): IntlCalendar tests --SKIPIF--
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> -<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?> --FILE--
<?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt b/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt new file mode 100644 index 0000000000..0312524148 --- /dev/null +++ b/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt @@ -0,0 +1,41 @@ +--TEST-- +IntlDateFormatter::formatObject(): IntlCalendar tests +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", "Europe/Lisbon"); + +$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00'); //Europe/Lisbon +echo IntlDateFormatter::formatObject($cal), "\n"; +echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n"; +echo IntlDateFormatter::formatObject($cal, null, "en-US"), "\n"; +echo IntlDateFormatter::formatObject($cal, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n"; +echo IntlDateFormatter::formatObject($cal, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n"; + +$cal = IntlCalendar::fromDateTime('2012-01-01 05:00:00+03:00'); +echo datefmt_format_object($cal, IntlDateFormatter::FULL), "\n"; + +$cal = IntlCalendar::createInstance(null,'en-US@calendar=islamic-civil'); +$cal->setTime(strtotime('2012-01-01 00:00:00')*1000.); +echo IntlDateFormatter::formatObject($cal), "\n"; +echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n"; + +?> +==DONE== + +--EXPECTF-- +01/01/2012, 00:00:00 +domingo, 1 de Janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental +Jan 1, 2012, 12:00:00 AM +1/1/12, 12:00:00 AM Western European Standard %STime +Sun 2012-01-1 00,00,00.000 Portugal Time +domingo, 1 de Janeiro de 2012 às 05:00:00 GMT+03:00 +06/02/1433, 00:00:00 +Sunday, Safar 6, 1433 at 12:00:00 AM Western European Standard Time +==DONE== diff --git a/ext/intl/tests/dateformat_formatObject_calendar_variant4.phpt b/ext/intl/tests/dateformat_formatObject_calendar_variant4.phpt new file mode 100644 index 0000000000..2ca57c245f --- /dev/null +++ b/ext/intl/tests/dateformat_formatObject_calendar_variant4.phpt @@ -0,0 +1,40 @@ +--TEST-- +IntlDateFormatter::formatObject(): IntlCalendar tests +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", "Europe/Lisbon"); + +$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00'); //Europe/Lisbon +echo IntlDateFormatter::formatObject($cal), "\n"; +echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n"; +echo IntlDateFormatter::formatObject($cal, null, "en-US"), "\n"; +echo IntlDateFormatter::formatObject($cal, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n"; +echo IntlDateFormatter::formatObject($cal, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n"; + +$cal = IntlCalendar::fromDateTime('2012-01-01 05:00:00+03:00'); +echo datefmt_format_object($cal, IntlDateFormatter::FULL), "\n"; + +$cal = IntlCalendar::createInstance(null,'en-US@calendar=islamic-civil'); +$cal->setTime(strtotime('2012-01-01 00:00:00')*1000.); +echo IntlDateFormatter::formatObject($cal), "\n"; +echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n"; + +?> +==DONE== + +--EXPECTF-- +01/01/2012, 00:00:00 +domingo, 1 de janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental +Jan 1, 2012, 12:00:00 AM +1/1/12, 12:00:00 AM Western European Standard %STime +Sun 2012-01-1 00,00,00.000 Portugal Time +domingo, 1 de janeiro de 2012 às 05:00:00 GMT+03:00 +06/02/1433, 00:00:00 +Sunday, Safar 6, 1433 at 12:00:00 AM Western European Standard Time +==DONE== diff --git a/ext/intl/tests/dateformat_formatObject_datetime_variant2.phpt b/ext/intl/tests/dateformat_formatObject_datetime_variant2.phpt index 2ca9ffd7e8..b4e59f5b7e 100644 --- a/ext/intl/tests/dateformat_formatObject_datetime_variant2.phpt +++ b/ext/intl/tests/dateformat_formatObject_datetime_variant2.phpt @@ -3,7 +3,7 @@ IntlDateFormatter::formatObject(): DateTime tests --SKIPIF--
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> -<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?> --FILE--
<?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt b/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt new file mode 100644 index 0000000000..5e0bb04a4f --- /dev/null +++ b/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt @@ -0,0 +1,34 @@ +--TEST-- +IntlDateFormatter::formatObject(): DateTime tests +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", "Europe/Lisbon"); + +$dt = new DateTime('2012-01-01 00:00:00'); //Europe/Lisbon +echo IntlDateFormatter::formatObject($dt), "\n"; +echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n"; +echo IntlDateFormatter::formatObject($dt, null, "en-US"), "\n"; +echo IntlDateFormatter::formatObject($dt, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n"; +echo IntlDateFormatter::formatObject($dt, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n"; + +$dt = new DateTime('2012-01-01 05:00:00+03:00'); +echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n"; + +?> +==DONE== + +--EXPECTF-- +01/01/2012, 00:00:00 +domingo, 1 de janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental +Jan 1, 2012, 12:00:00 AM +1/1/12, 12:00:00 AM Western European Standard %STime +Sun 2012-01-1 00,00,00.000 Portugal Time +domingo, 1 de janeiro de 2012 às 05:00:00 GMT+03:00 +==DONE== diff --git a/ext/intl/tests/dateformat_formatObject_datetime_variant4.phpt b/ext/intl/tests/dateformat_formatObject_datetime_variant4.phpt new file mode 100644 index 0000000000..c47e2b59bd --- /dev/null +++ b/ext/intl/tests/dateformat_formatObject_datetime_variant4.phpt @@ -0,0 +1,33 @@ +--TEST-- +IntlDateFormatter::formatObject(): DateTime tests +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", "Europe/Lisbon"); + +$dt = new DateTime('2012-01-01 00:00:00'); //Europe/Lisbon +echo IntlDateFormatter::formatObject($dt), "\n"; +echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n"; +echo IntlDateFormatter::formatObject($dt, null, "en-US"), "\n"; +echo IntlDateFormatter::formatObject($dt, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n"; +echo IntlDateFormatter::formatObject($dt, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n"; + +$dt = new DateTime('2012-01-01 05:00:00+03:00'); +echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n"; + +?> +==DONE== + +--EXPECTF-- +01/01/2012, 00:00:00 +domingo, 1 de janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental +Jan 1, 2012, 12:00:00 AM +1/1/12, 12:00:00 AM Western European Standard %STime +Sun 2012-01-1 00,00,00.000 Portugal Time +domingo, 1 de janeiro de 2012 às 05:00:00 GMT+03:00 +==DONE== diff --git a/ext/intl/tests/dateformat_get_set_calendar_variant2.phpt b/ext/intl/tests/dateformat_get_set_calendar_variant2.phpt index 1c5169e65d..9e8d76c1bb 100644 --- a/ext/intl/tests/dateformat_get_set_calendar_variant2.phpt +++ b/ext/intl/tests/dateformat_get_set_calendar_variant2.phpt @@ -3,7 +3,7 @@ IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject() --SKIPIF-- <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> -<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt b/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt new file mode 100644 index 0000000000..97f2911cfe --- /dev/null +++ b/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt @@ -0,0 +1,56 @@ +--TEST-- +IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject() +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +function d(IntlDateFormatter $df) { +global $ts; +echo $df->format($ts), "\n"; +var_dump($df->getCalendar(), +$df->getCalendarObject()->getType(), +$df->getCalendarObject()->getTimeZone()->getId()); +echo "\n"; +} + +$df = new IntlDateFormatter('fr@calendar=islamic', 0, 0, 'Europe/Minsk'); +d($df); + + +//changing the calendar with a cal type should not change tz +$df->setCalendar(IntlDateFormatter::TRADITIONAL); +d($df); + +//but changing with an actual calendar should +$cal = IntlCalendar::createInstance("UTC"); +$df->setCalendar($cal); +d($df); + +?> +==DONE== +--EXPECT-- +dimanche 1 janvier 2012 ap. J.-C. à 03:00:00 UTC+03:00 +int(1) +string(9) "gregorian" +string(12) "Europe/Minsk" + +dimanche 8 safar 1433 AH à 03:00:00 UTC+03:00 +int(0) +string(7) "islamic" +string(12) "Europe/Minsk" + +dimanche 1 janvier 2012 ap. J.-C. à 00:00:00 UTC +bool(false) +string(9) "gregorian" +string(3) "UTC" + +==DONE== diff --git a/ext/intl/tests/dateformat_get_set_calendar_variant4.phpt b/ext/intl/tests/dateformat_get_set_calendar_variant4.phpt new file mode 100644 index 0000000000..dc9db09740 --- /dev/null +++ b/ext/intl/tests/dateformat_get_set_calendar_variant4.phpt @@ -0,0 +1,55 @@ +--TEST-- +IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject() +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +function d(IntlDateFormatter $df) { +global $ts; +echo $df->format($ts), "\n"; +var_dump($df->getCalendar(), +$df->getCalendarObject()->getType(), +$df->getCalendarObject()->getTimeZone()->getId()); +echo "\n"; +} + +$df = new IntlDateFormatter('fr@calendar=islamic', 0, 0, 'Europe/Minsk'); +d($df); + + +//changing the calendar with a cal type should not change tz +$df->setCalendar(IntlDateFormatter::TRADITIONAL); +d($df); + +//but changing with an actual calendar should +$cal = IntlCalendar::createInstance("UTC"); +$df->setCalendar($cal); +d($df); + +?> +==DONE== +--EXPECT-- +dimanche 1 janvier 2012 ap. J.-C. à 03:00:00 heure de Kaliningrad +int(1) +string(9) "gregorian" +string(12) "Europe/Minsk" + +dimanche 8 safar 1433 AH à 03:00:00 heure de Kaliningrad +int(0) +string(7) "islamic" +string(12) "Europe/Minsk" + +dimanche 1 janvier 2012 ap. J.-C. à 00:00:00 UTC +bool(false) +string(9) "gregorian" +string(3) "UTC" + +==DONE== diff --git a/ext/intl/tests/dateformat_get_set_timezone_variant2.phpt b/ext/intl/tests/dateformat_get_set_timezone_variant2.phpt index af9ddf29a4..f19f0ffd5b 100644 --- a/ext/intl/tests/dateformat_get_set_timezone_variant2.phpt +++ b/ext/intl/tests/dateformat_get_set_timezone_variant2.phpt @@ -3,7 +3,7 @@ IntlDateFormatter: get/setTimeZone() --SKIPIF-- <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> -<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt b/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt new file mode 100644 index 0000000000..a06bbc1eaa --- /dev/null +++ b/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt @@ -0,0 +1,63 @@ +--TEST-- +IntlDateFormatter: get/setTimeZone() +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +function d(IntlDateFormatter $df) { +global $ts; +echo $df->format($ts), "\n"; +var_dump( +$df->getTimeZoneID(), +$df->getTimeZone()->getID()); +echo "\n"; +} + +$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk'); +d($df); + +$df->setTimeZone(NULL); +d($df); + +$df->setTimeZone('Europe/Madrid'); +d($df); + +$df->setTimeZone(IntlTimeZone::createTimeZone('Europe/Paris')); +d($df); + +$df->setTimeZone(new DateTimeZone('Europe/Amsterdam')); +d($df); + +?> +==DONE== +--EXPECTF-- +domingo, 1 de Janeiro de 2012 às 03:00:00 GMT+03:00 +string(12) "Europe/Minsk" +string(12) "Europe/Minsk" + +sábado, 31 de Dezembro de 2011 às 23:00:00 Hor%s Padrão %Sdos Açores +string(15) "Atlantic/Azores" +string(15) "Atlantic/Azores" + +domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central +string(13) "Europe/Madrid" +string(13) "Europe/Madrid" + +domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central +string(12) "Europe/Paris" +string(12) "Europe/Paris" + +domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central +string(16) "Europe/Amsterdam" +string(16) "Europe/Amsterdam" + +==DONE== diff --git a/ext/intl/tests/dateformat_get_set_timezone_variant4.phpt b/ext/intl/tests/dateformat_get_set_timezone_variant4.phpt new file mode 100644 index 0000000000..adedd74965 --- /dev/null +++ b/ext/intl/tests/dateformat_get_set_timezone_variant4.phpt @@ -0,0 +1,62 @@ +--TEST-- +IntlDateFormatter: get/setTimeZone() +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +function d(IntlDateFormatter $df) { +global $ts; +echo $df->format($ts), "\n"; +var_dump( +$df->getTimeZoneID(), +$df->getTimeZone()->getID()); +echo "\n"; +} + +$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk'); +d($df); + +$df->setTimeZone(NULL); +d($df); + +$df->setTimeZone('Europe/Madrid'); +d($df); + +$df->setTimeZone(IntlTimeZone::createTimeZone('Europe/Paris')); +d($df); + +$df->setTimeZone(new DateTimeZone('Europe/Amsterdam')); +d($df); + +?> +==DONE== +--EXPECTF-- +domingo, 1 de janeiro de 2012 às 03:00:00 Hor%s do Extremo Leste da Europa +string(12) "Europe/Minsk" +string(12) "Europe/Minsk" + +sábado, 31 de dezembro de 2011 às 23:00:00 Hor%s Padrão %Sdos Açores +string(15) "Atlantic/Azores" +string(15) "Atlantic/Azores" + +domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central +string(13) "Europe/Madrid" +string(13) "Europe/Madrid" + +domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central +string(12) "Europe/Paris" +string(12) "Europe/Paris" + +domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central +string(16) "Europe/Amsterdam" +string(16) "Europe/Amsterdam" + +==DONE== diff --git a/ext/intl/tests/dateformat_timezone_arg_variations2.phpt b/ext/intl/tests/dateformat_timezone_arg_variations2.phpt index a957963a44..53ee820540 100644 --- a/ext/intl/tests/dateformat_timezone_arg_variations2.phpt +++ b/ext/intl/tests/dateformat_timezone_arg_variations2.phpt @@ -3,7 +3,7 @@ IntlDateFormatter: several forms of the timezone arg --SKIPIF-- <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> -<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_timezone_arg_variations3.phpt b/ext/intl/tests/dateformat_timezone_arg_variations3.phpt new file mode 100644 index 0000000000..f8aaf2bd4a --- /dev/null +++ b/ext/intl/tests/dateformat_timezone_arg_variations3.phpt @@ -0,0 +1,46 @@ +--TEST-- +IntlDateFormatter: several forms of the timezone arg +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +//should use Atlantic/Azores +$df = new IntlDateFormatter('es_ES', 0, 0, NULL); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam'); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, new DateTimeZone('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, IntlTimeZone::createTimeZone('America/New_York')); +echo $df->format($ts), "\n"; + +//time zone has priority +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', new IntlGregorianCalendar('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +//calendar has priority +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, new IntlGregorianCalendar('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0); +echo $df->format($ts), "\n"; + +--EXPECTF-- +sábado%S 31 de diciembre de 2011, 23:00:00 (Hora estándar de las Azores) +domingo%S 1 de enero de 2012, 1:00:00 (Hora estándar de Europa central) +domingo%S 1 de enero de 2012, 0:00:00 (Hora%S estándar de Europa occidental) +sábado%S 31 de diciembre de 2011, 19:00:00 (Hora estándar oriental) +domingo%S 1 de enero de 2012, 1:00:00 (Hora estándar de Europa central) +domingo%S 1 de enero de 2012, 0:00:00 (Hora%S estándar de Europa occidental) +domingo%S 1 de enero de 2012, 1:00:00 (Hora estándar de Europa central) diff --git a/ext/intl/tests/dateformat_timezone_arg_variations4.phpt b/ext/intl/tests/dateformat_timezone_arg_variations4.phpt new file mode 100644 index 0000000000..7be709a66f --- /dev/null +++ b/ext/intl/tests/dateformat_timezone_arg_variations4.phpt @@ -0,0 +1,46 @@ +--TEST-- +IntlDateFormatter: several forms of the timezone arg +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +//should use Atlantic/Azores +$df = new IntlDateFormatter('es_ES', 0, 0, NULL); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam'); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, new DateTimeZone('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, IntlTimeZone::createTimeZone('America/New_York')); +echo $df->format($ts), "\n"; + +//time zone has priority +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', new IntlGregorianCalendar('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +//calendar has priority +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, new IntlGregorianCalendar('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0); +echo $df->format($ts), "\n"; + +--EXPECTF-- +sábado, 31 de diciembre de 2011, 23:00:00 (hora estándar de las Azores) +domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central) +domingo, 1 de enero de 2012, 0:00:00 (hora estándar de Europa occidental) +sábado, 31 de diciembre de 2011, 19:00:00 (hora estándar oriental) +domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central) +domingo, 1 de enero de 2012, 0:00:00 (hora estándar de Europa occidental) +domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central) + diff --git a/ext/intl/tests/formatter_format4.phpt b/ext/intl/tests/formatter_format4.phpt index 88d457bdb3..96dd7be53e 100644 --- a/ext/intl/tests/formatter_format4.phpt +++ b/ext/intl/tests/formatter_format4.phpt @@ -1,8 +1,9 @@ --TEST-- -numfmt_format() icu >= 53.1 +numfmt_format() icu >= 53.1 && icu < 54.1 --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> <?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php diff --git a/ext/intl/tests/formatter_format5.phpt b/ext/intl/tests/formatter_format5.phpt new file mode 100644 index 0000000000..cbaf140a0f --- /dev/null +++ b/ext/intl/tests/formatter_format5.phpt @@ -0,0 +1,130 @@ +--TEST-- +numfmt_format() icu >= 54.1 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php + +/* + * Format a number using misc locales/patterns. + */ + +/* + * TODO: doesn't pass on ICU 3.6 because 'ru' and 'de' locales changed + * currency and percent formatting. + */ + +function ut_main() +{ + $styles = array( + NumberFormatter::PATTERN_DECIMAL => '##.#####################', + NumberFormatter::DECIMAL => '', + NumberFormatter::CURRENCY => '', + NumberFormatter::PERCENT => '', + NumberFormatter::SCIENTIFIC => '', + NumberFormatter::SPELLOUT => '@@@@@@@', + NumberFormatter::ORDINAL => '', + NumberFormatter::DURATION => '', + NumberFormatter::PATTERN_RULEBASED => '#####.###', + 1234999, // bad one + ); + + $integer = array( + NumberFormatter::ORDINAL => '', + NumberFormatter::DURATION => '', + ); + $locales = array( + 'en_US', + 'ru_UA', + 'de', + 'fr', + 'en_UK' + ); + + $str_res = ''; + $number = 1234567.891234567890000; + + foreach( $locales as $locale ) + { + $str_res .= "\nLocale is: $locale\n"; + foreach( $styles as $style => $pattern ) + { + $fmt = ut_nfmt_create( $locale, $style, $pattern ); + + if(!$fmt) { + $str_res .= "Bad formatter!\n"; + continue; + } + $str_res .= dump( isset($integer[$style])?ut_nfmt_format( $fmt, $number, NumberFormatter::TYPE_INT32):ut_nfmt_format( $fmt, $number ) ) . "\n"; + } + } + return $str_res; +} + +include_once( 'ut_common.inc' ); + +// Run the test +ut_run(); + +?> +--EXPECTREGEX-- +Locale is: en_US +'1234567.89123457' +'1,234,567.891' +'\$1,234,567.89' +'123,456,789%' +'1.23456789123457E6' +'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five seven' +'1,234,567(th|ᵗʰ)' +'342:56:07' +'#####.###' +'USD1,234,567.89' + +Locale is: ru_UA +'1234567,89123457' +'1 234 567,891' +'1 234 567,89 ?(грн\.|₴)' +'123 456 789 ?%' +'1,23456789123457E6' +'один миллион двести тридцать четыре тысячи пятьсот шестьдесят семь запятая восемь девять один два три четыре пять семь' +'1 234 567.?' +'1 234 567' +'#####.###' +'1 234 567,89 UAH' + +Locale is: de +'1234567,89123457' +'1.234.567,891' +'(¤ )?1.234.567,89( ¤)?' +'123\.456\.789 %' +'1,23456789123457E6' +'eine Million zweihundertvierunddreißigtausendfünfhundertsiebenundsechzig Komma acht neun eins zwei drei vier fünf sieben' +'1.234.567.?' +'1.234.567' +'#####.###' +'1.234.567,89 ¤¤' + +Locale is: fr +'1234567,89123457' +'1 234 567,891' +'1 234 567,89 ¤' +'123 456 789 ?%' +'1,23456789123457E6' +'un million deux cent trente-quatre mille cinq cent soixante-sept virgule huit neuf un deux trois quatre cinq sept' +'1 234 567e' +'1 234 567' +'#####.###' +'1 234 567,89 ¤¤' + +Locale is: en_UK +'1234567.89123457' +'1,234,567.891' +'¤1,234,567.89' +'123,456,789%' +'1.23456789123457E6' +'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five seven' +'1,234,567(th|ᵗʰ)' +'342:56:07' +'#####.###' +'¤¤1,234,567.89' diff --git a/ext/intl/tests/msgfmt_format_intlcalendar_variant2.phpt b/ext/intl/tests/msgfmt_format_intlcalendar_variant2.phpt index f2d16b899d..55dd0e4057 100644 --- a/ext/intl/tests/msgfmt_format_intlcalendar_variant2.phpt +++ b/ext/intl/tests/msgfmt_format_intlcalendar_variant2.phpt @@ -3,7 +3,7 @@ MessageFormat accepts IntlCalendar args --SKIPIF-- <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> -<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '51.2') || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt b/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt new file mode 100644 index 0000000000..766c508d31 --- /dev/null +++ b/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt @@ -0,0 +1,31 @@ +--TEST-- +MessageFormat accepts IntlCalendar args +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +//ini_set("intl.default_locale", "nl"); +ini_set('date.timezone', 'Europe/Lisbon'); + +$cal = new IntlGregorianCalendar(2012,04,17,17,35,36); + +$msgf = new MessageFormatter('pt_PT', '{0,date,full} {0,time,h:m:s a V}'); +echo $msgf->format(array($cal)), "\n"; + +//NOT FIXED: +/*$msgf = new MessageFormatter('en_US', +'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}'); + +echo "msgf2: ", $msgf->format(array($time, 'date')), " ", + $msgf->format(array($time, 'time')), "\n"; +*/ + +?> +==DONE== +--EXPECT-- +quinta-feira, 17 de Maio de 2012 5:35:36 da tarde ptlis +==DONE== diff --git a/ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt b/ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt new file mode 100644 index 0000000000..8f778b9029 --- /dev/null +++ b/ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt @@ -0,0 +1,30 @@ +--TEST-- +MessageFormat accepts IntlCalendar args +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +//ini_set("intl.default_locale", "nl"); +ini_set('date.timezone', 'Europe/Lisbon'); + +$cal = new IntlGregorianCalendar(2012,04,17,17,35,36); + +$msgf = new MessageFormatter('pt_PT', '{0,date,full} {0,time,h:m:s a V}'); +echo $msgf->format(array($cal)), "\n"; + +//NOT FIXED: +/*$msgf = new MessageFormatter('en_US', +'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}'); + +echo "msgf2: ", $msgf->format(array($time, 'date')), " ", + $msgf->format(array($time, 'time')), "\n"; +*/ + +?> +==DONE== +--EXPECT-- +quinta-feira, 17 de maio de 2012 5:35:36 da tarde ptlis +==DONE== diff --git a/ext/mysqlnd/config9.m4 b/ext/mysqlnd/config9.m4 index deda4414c4..e665cd0a8b 100644 --- a/ext/mysqlnd/config9.m4 +++ b/ext/mysqlnd/config9.m4 @@ -70,12 +70,17 @@ dnl AC_CACHE_CHECK([whether whether compiler supports Decimal32/64/128 types], ac_cv_decimal_fp_supported,[ AC_TRY_RUN( [ #include <stdio.h> +#include <string.h> int main(int argc, char **argv) { typedef float dec32 __attribute__((mode(SD))); dec32 k = 99.49f; double d2 = (double)k; - return 0; + const char *check_str = "99.49"; + char print_str[32]; + + snprintf(print_str, 32, "%f", d2); + return memcmp(print_str, check_str, 5); } ],[ ac_cv_decimal_fp_supported=yes diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 19f9fe4eb0..b9bee9676a 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -951,14 +951,15 @@ int odbc_bindcols(odbc_result *result TSRMLS_DC) SQLUSMALLINT colfieldid; int charextraalloc; - colfieldid = SQL_COLUMN_DISPLAY_SIZE; - charextraalloc = 0; result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0); result->longreadlen = ODBCG(defaultlrl); result->binmode = ODBCG(defaultbinmode); for(i = 0; i < result->numcols; i++) { + charextraalloc = 0; + colfieldid = SQL_COLUMN_DISPLAY_SIZE; + rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_NAME, result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0); rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE, diff --git a/ext/odbc/tests/bug68087.phpt b/ext/odbc/tests/bug68087.phpt new file mode 100644 index 0000000000..3bc18125a6 --- /dev/null +++ b/ext/odbc/tests/bug68087.phpt @@ -0,0 +1,57 @@ +--TEST-- +odbc_exec(): Getting accurate date data from query +--SKIPIF-- +<?php include 'skipif.inc'; ?> +--FILE-- +<?php + +include 'config.inc'; + +$id_1_date = '2014-09-23'; +$id_2_date = '2014-09-24'; + +$conn = odbc_connect($dsn, $user, $pass); + +@odbc_exec($conn, 'CREATE DATABASE odbcTEST'); + +odbc_exec($conn, 'CREATE TABLE FOO (ID INT, VARCHAR_COL VARCHAR(100), DATE_COL DATE)'); + +odbc_exec($conn, "INSERT INTO FOO(ID, VARCHAR_COL, DATE_COL) VALUES (1, 'hello', '$id_1_date')"); +odbc_exec($conn, "INSERT INTO FOO(ID, VARCHAR_COL, DATE_COL) VALUES (2, 'helloagain', '$id_2_date')"); + +$res = odbc_exec($conn, 'SELECT * FROM FOO ORDER BY ID ASC'); + +while(odbc_fetch_row($res)) { + $id = odbc_result($res, "ID"); + $varchar_col = odbc_result($res, "VARCHAR_COL"); + $date = odbc_result($res, "DATE_COL"); + + if ($id == 1) { + if ($date != $id_1_date) { + print "Date_1 mismatched\n"; + } else { + print "Date_1 matched\n"; + } + } else { + if ($date != $id_2_date) { + print "Date_2 mismatched\n"; + } else { + print "Date_2 matched\n"; + } + } +} + +?> +--EXPECT-- +Date_1 matched +Date_2 matched +--CLEAN-- +<?php +include 'config.inc'; + +$conn = odbc_connect($dsn, $user, $pass); + +odbc_exec($conn, 'DROP TABLE FOO'); +odbc_exec($conn, 'DROP DATABASE odbcTEST'); + +?> diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 44064004f8..1d3bd959ff 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -881,12 +881,12 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC) { if (ZCG(accel_directives).revalidate_freq && - (persistent_script->dynamic_members.revalidate >= ZCSG(revalidate_at))) { + persistent_script->dynamic_members.revalidate >= ZCG(request_time)) { return SUCCESS; } else if (do_validate_timestamps(persistent_script, file_handle TSRMLS_CC) == FAILURE) { return FAILURE; } else { - persistent_script->dynamic_members.revalidate = ZCSG(revalidate_at); + persistent_script->dynamic_members.revalidate = ZCG(request_time) + ZCG(accel_directives).revalidate_freq; return SUCCESS; } } @@ -1449,7 +1449,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han * otherwise we have a race-condition. */ new_persistent_script->timestamp = timestamp; - new_persistent_script->dynamic_members.revalidate = ZCSG(revalidate_at); + new_persistent_script->dynamic_members.revalidate = ZCG(request_time) + ZCG(accel_directives).revalidate_freq; } if (file_handle->opened_path) { @@ -2155,13 +2155,6 @@ static void accel_activate(void) zend_accel_error(ACCEL_LOG_WARNING, "Internal functions count changed - was %d, now %d", ZCG(internal_functions_count), zend_hash_num_elements(&ZCG(function_table))); } - if (ZCG(accel_directives).validate_timestamps) { - time_t now = ZCG(request_time); - if (now > ZCSG(revalidate_at) + (time_t)ZCG(accel_directives).revalidate_freq) { - ZCSG(revalidate_at) = now; - } - } - ZCG(cwd) = NULL; SHM_PROTECT(); @@ -2622,10 +2615,6 @@ static int accel_startup(zend_extension *extension) zend_resolve_path = persistent_zend_resolve_path; #endif - if (ZCG(accel_directives).validate_timestamps) { - ZCSG(revalidate_at) = zend_accel_get_time() + ZCG(accel_directives).revalidate_freq; - } - /* Override chdir() function */ if (zend_hash_find(CG(function_table), "chdir", sizeof("chdir"), (void**)&func) == SUCCESS && func->type == ZEND_INTERNAL_FUNCTION) { diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index bba36316d9..547e315823 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -297,7 +297,6 @@ typedef struct _zend_accel_shared_globals { unsigned long restart_in; #endif zend_bool restart_in_progress; - time_t revalidate_at; #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO /* Interned Strings Support */ char *interned_strings_start; diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 5736caa2e5..1ce9541094 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -204,59 +204,13 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size return didwrite; } -static void php_openssl_stream_wait_for_data(php_netstream_data_t *sock) -{ - int retval; - struct timeval *ptimeout; - - if (sock->socket == -1) { - return; - } - - sock->timeout_event = 0; - - if (sock->timeout.tv_sec == -1) - ptimeout = NULL; - else - ptimeout = &sock->timeout; - - while(1) { - retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout); - - if (retval == 0) - sock->timeout_event = 1; - - if (retval >= 0) - break; - - if (php_socket_errno() != EINTR) - break; - } -} - static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) { php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; - php_netstream_data_t *sock; int nr_bytes = 0; if (sslsock->ssl_active) { int retry = 1; - sock = (php_netstream_data_t*)stream->abstract; - - /* The SSL_read() function will block indefinitely waiting for data on a blocking - socket. If we don't poll for readability first this operation has the potential - to hang forever. To avoid this scenario we poll with a timeout before performing - the actual read. If it times out we're finished. - */ - if (sock->is_blocked && SSL_pending(sslsock->ssl_handle) == 0) { - php_openssl_stream_wait_for_data(sock); - if (sock->timeout_event) { - stream->eof = 1; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL read operation timed out"); - return nr_bytes; - } - } do { nr_bytes = SSL_read(sslsock->ssl_handle, buf, count); diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 196ada0266..e2dd7ca759 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (global && subpats && subpats_order == PREG_PATTERN_ORDER) { match_sets = (zval **)safe_emalloc(num_subpats, sizeof(zval *), 0); diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 3be9359216..17757a7b2d 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -465,6 +465,15 @@ static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC) } /* }}} */ +static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC) +{ + pdo_pgsql_db_handle *H; + + H = (pdo_pgsql_db_handle *)dbh->driver_data; + + return PQtransactionStatus(H->server) > PQTRANS_IDLE; +} + static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC) { pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; @@ -489,7 +498,15 @@ static int pgsql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) static int pgsql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) { - return pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC); + int ret = pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC); + + /* When deferred constraints are used the commit could + fail, and a ROLLBACK implicitly ran. See bug #67462 */ + if (!ret) { + dbh->in_txn = pgsql_handle_in_transaction(dbh TSRMLS_CC); + } + + return ret; } static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) @@ -497,15 +514,6 @@ static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC); } -static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_pgsql_db_handle *H; - - H = (pdo_pgsql_db_handle *)dbh->driver_data; - - return PQtransactionStatus(H->server); -} - /* {{{ proto string PDO::pgsqlCopyFromArray(string $table_name , array $rows [, string $delimiter [, string $null_as ] [, string $fields]) Returns true if the copy worked fine or false if error */ static PHP_METHOD(PDO, pgsqlCopyFromArray) diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index ea5a67633e..4e183311e2 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -294,7 +294,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * sizeof(Oid)); } if (param->paramno >= 0) { - if (param->paramno > zend_hash_num_elements(stmt->bound_param_map)) { + if (param->paramno >= zend_hash_num_elements(stmt->bound_param_map)) { pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY105"); return 0; } @@ -370,6 +370,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * ((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) { SEPARATE_ZVAL(¶m->parameter); param->param_type = PDO_PARAM_STR; + convert_to_boolean(param->parameter); ZVAL_STRINGL(param->parameter, Z_BVAL_P(param->parameter) ? "t" : "f", 1, 1); } } diff --git a/ext/pdo_pgsql/tests/bug62593.phpt b/ext/pdo_pgsql/tests/bug62593.phpt index e3ebf46ed5..4ab4566f00 100644 --- a/ext/pdo_pgsql/tests/bug62593.phpt +++ b/ext/pdo_pgsql/tests/bug62593.phpt @@ -34,6 +34,19 @@ $query->execute(); $errors[] = $query->errorInfo(); var_dump($value); +// Try with strings - Bug #68351 +$value = '0'; +$query->bindParam(':foo', $value, PDO::PARAM_BOOL); +$query->execute(); +$errors[] = $query->errorInfo(); +var_dump($query->fetchColumn()); + +$value = "abc"; +$query->bindParam(':foo', $value, PDO::PARAM_BOOL); +$query->execute(); +$errors[] = $query->errorInfo(); +var_dump($query->fetchColumn()); + $expect = 'No errors found'; foreach ($errors as $error) @@ -48,4 +61,6 @@ echo $expect; --EXPECTF-- bool(true) bool(false) +bool(true) +bool(false) No errors found diff --git a/ext/pdo_pgsql/tests/bug66584.phpt b/ext/pdo_pgsql/tests/bug66584.phpt new file mode 100644 index 0000000000..07742bca79 --- /dev/null +++ b/ext/pdo_pgsql/tests/bug66584.phpt @@ -0,0 +1,66 @@ +--TEST-- +PDO PgSQL Bug #66584 (Segmentation fault on statement deallocation) +--SKIPIF-- +<?php +if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded'); +require dirname(__FILE__) . '/config.inc'; +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +PDOTest::skip(); +?> +--FILE-- +<?php +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +$pdo = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); + +$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + +$pdo->beginTransaction(); + +$pdo->query("CREATE TABLE b66584 (a int)"); +$pdo->query("INSERT INTO b66584 VALUES (165)"); + +for ($i = 1; $i >= 0; $i--) { + $pdo->setAttribute(\PDO::ATTR_EMULATE_PREPARES, (bool)$i); + + try { + run($pdo, [0 => 1, 2 => 165, 5 => 3]); + } catch (\Exception $e) { + var_dump($e->getMessage()); + } + + try { + run($pdo, json_decode('{"0":234,"1":165,"2":221,"3":207,"4":188,"5":216,"6":1150,"7":916,"8":967,"9":987,"10":951,"11":990,"12":959,"13":896,"14":947,"15":877,"16":1000,"17":1023,"18":904,"19":856,"20":860,"21":866,"22":930,"23":974,"24":1032,"25":1016,"26":1050,"27":1059,"28":1040,"29":1064,"30":1004,"31":214,"32":189,"33":166,"34":1002,"35":167,"36":191,"37":859,"38":204,"39":181,"40":1001,"42":208,"43":198,"44":177,"45":1003,"46":858,"47":190,"48":162,"49":210,"50":171,"51":197,"52":168,"53":194,"54":209,"55":200,"56":192,"57":180,"58":232,"59":222,"60":163,"61":196,"62":217,"64":176,"65":193,"66":172,"67":195,"68":170,"69":173,"70":233,"71":223,"72":218,"73":186,"74":175,"75":224,"76":205,"77":211,"78":235,"79":1101,"80":225,"81":236,"82":1102,"83":1164,"84":1083,"85":1005,"86":861,"87":1179,"88":960,"89":991,"90":1187,"91":880,"92":1149,"93":1033,"94":931,"95":1006,"96":862,"97":1151,"98":917,"99":881,"100":1148,"101":1065,"102":867,"103":952,"104":1152,"105":918,"106":961,"107":1180,"108":992,"109":1188,"110":932,"111":933,"112":968,"113":868,"114":882,"115":1147,"116":1017,"117":1131,"118":1174,"119":1178,"120":1186,"121":869,"122":1051,"123":934,"124":969,"125":975,"126":1066,"127":237,"128":953,"129":1024,"130":1146,"131":883,"132":1145,"133":884,"134":885,"135":1144,"136":886,"137":1143,"138":1025,"139":897,"140":898,"141":899,"142":1026,"143":1142,"144":887,"145":1141,"146":888,"147":889,"148":1140,"149":1189,"150":993,"151":1139,"152":890,"153":1138,"154":891,"155":900,"156":892,"157":1137,"158":1027,"159":901,"160":1136,"161":893,"162":870,"163":1052,"164":954,"165":1041,"166":1018,"167":1165,"168":1084,"169":962,"170":1181,"171":994,"172":1190,"173":1042,"174":935,"175":226,"176":871,"177":1191,"178":995,"179":977,"180":948,"181":1175,"182":1053,"183":955,"184":1182,"185":963,"186":1067,"187":919,"188":1153,"189":920,"190":1154,"191":1055,"192":1054,"193":1056,"194":863,"195":872,"196":1028,"197":921,"198":1155,"199":936,"200":970,"201":1019,"202":1166,"203":1085,"204":1135,"205":894,"206":1034,"207":905,"208":873,"209":937,"210":902,"211":1029,"212":1007,"213":864,"214":1043,"215":1057,"216":956,"217":957,"218":939,"219":1086,"220":1167,"221":1087,"222":1168,"223":1173,"224":1108,"225":978,"226":1044,"227":1183,"228":964,"229":965,"230":1184,"231":1045,"232":874,"233":940,"234":1046,"235":979,"236":903,"237":980,"238":1156,"239":922,"240":1035,"241":906,"242":971,"243":972,"244":878,"245":1134,"246":879,"247":1133,"248":907,"249":1036,"250":908,"251":1132,"252":895,"253":909,"254":1060,"255":981,"256":1068,"257":996,"258":1192,"259":941,"260":865,"261":1008,"262":910,"263":997,"264":1193,"265":982,"266":942,"267":1020,"268":983,"269":1061,"270":949,"271":1176,"272":875,"273":911,"274":1069,"275":1157,"276":923,"277":1158,"278":924,"279":988,"280":984,"281":925,"282":1159,"283":1062,"284":1047,"285":1194,"286":998,"287":1021,"288":1030,"289":1031,"290":1070,"291":1088,"292":1169,"293":958,"294":1195,"295":999,"296":966,"297":1185,"298":944,"299":945,"300":1022,"301":1103,"302":220,"303":1099,"304":1048,"305":927,"306":1161,"307":989,"308":973,"309":1071,"310":1074,"311":1072,"312":1073,"313":912,"314":1037,"315":913,"316":914,"317":1177,"318":950,"319":1049,"320":876,"321":985,"322":915,"323":1038,"324":946,"325":1089,"326":1170,"327":1090,"328":1171,"329":1091,"330":1172,"331":1063,"332":986,"333":928,"334":1162,"335":929,"336":1163,"337":976,"338":231,"339":201,"340":1098,"341":215}', true)); + } catch (\Exception $e) { + var_dump($e->getMessage()); + } +} + +try { + $pdo->query("DROP TABLE b66584"); + $pdo->rollback(); +} catch (\Exception $e) { +} + +function run($pdo, $data) +{ + $bind = join(', ', array_fill(0, count($data), '?')); + + $stmt = $pdo->prepare("SELECT COUNT(*) FROM b66584 WHERE a IN ({$bind})"); + + var_dump(count($data)); + + $stmt->execute($data); + + var_dump($stmt->fetchColumn()); +} + +?> +--EXPECTF-- +int(3) +string(%d) "SQLSTATE%s" +int(340) +string(%d) "SQLSTATE%s" +int(3) +string(%d) "SQLSTATE%s" +int(340) +string(%d) "SQLSTATE%s" diff --git a/ext/pdo_pgsql/tests/bug67462.phpt b/ext/pdo_pgsql/tests/bug67462.phpt new file mode 100644 index 0000000000..888b19c248 --- /dev/null +++ b/ext/pdo_pgsql/tests/bug67462.phpt @@ -0,0 +1,34 @@ +--TEST-- +PDO PgSQL Bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception when not in transaction) +--SKIPIF-- +<?php +if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded'); +require dirname(__FILE__) . '/config.inc'; +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +PDOTest::skip(); +?> +--FILE-- +<?php + +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +$pdo = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); +$pdo->setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + +$pdo->beginTransaction(); + +try { + $pdo->query("CREATE TABLE b67462 (a int NOT NULL PRIMARY KEY DEFERRABLE INITIALLY DEFERRED)"); + $pdo->query("INSERT INTO b67462 VALUES (1), (1)"); + + var_dump($pdo->inTransaction()); + $pdo->commit(); // This should fail! +} catch (\Exception $e) { + var_dump($pdo->inTransaction()); + var_dump($pdo->beginTransaction()); +} + +?> +--EXPECT-- +bool(true) +bool(false) +bool(true) diff --git a/ext/pgsql/tests/config.inc b/ext/pgsql/tests/config.inc index d4bbb33824..224d055087 100644 --- a/ext/pgsql/tests/config.inc +++ b/ext/pgsql/tests/config.inc @@ -1,12 +1,15 @@ <?php + // These vars are used to connect db and create test table. -// values can be set to meet your environment +// values can be set to meet your environment with the +// environment var PGSQL_TEST_CONNSTR + +$conn_str = getenv('PGSQL_TEST_CONNSTR') ?: "host=localhost dbname=test port=5432"; // connection string -$conn_str = "host=localhost dbname=test port=5432"; // connection string $table_name = "php_pgsql_test"; // test table that should be exist $num_test_record = 1000; // Number of records to create $table_def = "CREATE TABLE php_pgsql_test (num int, str text, bin bytea);"; // Test table $field_name = "num"; // For pg_field_num() -?>
\ No newline at end of file +?> diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag index faa9db0c70..6516ddfabd 100644 --- a/ext/phar/Makefile.frag +++ b/ext/phar/Makefile.frag @@ -39,7 +39,7 @@ install-pharcmd: pharcmd -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) $(INSTALL) $(builddir)/phar.phar $(INSTALL_ROOT)$(bindir) -@rm -f $(INSTALL_ROOT)$(bindir)/phar - $(LN_S) -f $(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar + $(LN_S) -f $(INSTALL_ROOT)$(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1 @$(INSTALL_DATA) $(builddir)/phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.1 @$(INSTALL_DATA) $(builddir)/phar.phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.phar.1 diff --git a/ext/phar/phar.c b/ext/phar/phar.c index a5488937a8..cc0fad28eb 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -3380,6 +3380,7 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type zend_try { failed = 0; + CG(zend_lineno) = 0; res = phar_orig_compile_file(file_handle, type TSRMLS_CC); } zend_catch { failed = 1; diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 4294ceac81..95b780d3f0 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6061,7 +6061,7 @@ ZEND_END_ARG_INFO() static const zend_function_entry reflection_zend_extension_functions[] = { ZEND_ME(reflection, __clone, arginfo_reflection__void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) ZEND_ME(reflection_zend_extension, export, arginfo_reflection_extension_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_zend_extension, __construct, arginfo_reflection_extension___construct, 0) + ZEND_ME(reflection_zend_extension, __construct, arginfo_reflection_zend_extension___construct, 0) ZEND_ME(reflection_zend_extension, __toString, arginfo_reflection__void, 0) ZEND_ME(reflection_zend_extension, getName, arginfo_reflection__void, 0) ZEND_ME(reflection_zend_extension, getVersion, arginfo_reflection__void, 0) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index cca8c912e9..80a3a93cec 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -4746,6 +4746,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) zend_hash_find(type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType", sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType"), (void **)&attr) == SUCCESS && + (*attr)->extraAttributes && zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) { char *end = strchr((*ext)->val, '['); int len; @@ -4770,6 +4771,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType", sizeof(SOAP_1_2_ENC_NAMESPACE":itemType"), (void **)&attr) == SUCCESS && + (*attr)->extraAttributes && zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) { smart_str_appends(buf, (*ext)->val); smart_str_appendc(buf, ' '); @@ -4789,6 +4791,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize", sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"), (void **)&attr) == SUCCESS && + (*attr)->extraAttributes && zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arraySize"), (void **)&ext) == SUCCESS) { smart_str_appendc(buf, '['); smart_str_appends(buf, (*ext)->val); diff --git a/ext/soap/tests/bug68361.phpt b/ext/soap/tests/bug68361.phpt new file mode 100644 index 0000000000..6dbba8a425 --- /dev/null +++ b/ext/soap/tests/bug68361.phpt @@ -0,0 +1,114 @@ +--TEST-- +Bug #68361 Segmentation fault on SoapClient::__getTypes +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + +$xml = <<<XML +<?xml version="1.0" encoding="UTF-8"?> +<definitions name="TestServer" targetNamespace="http://foo.bar/testserver" xmlns:tns="http://foo.bar/testserver" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://foo.bar/testserver/types"> + <types> + <xsd:schema targetNamespace="http://foo.bar/testserver/types" xmlns="http://foo.bar/testserver/types"> + <xsd:complexType name="ArrayOfEmployeeReturn"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" arrayType="ns:Employee[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="Employee"> + <xsd:sequence> + <xsd:element name="id" type="xsd:int"/> + <xsd:element name="department" type="xsd:string"/> + <xsd:element name="name" type="xsd:string"/> + <xsd:element name="age" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="Employee" nillable="true" type="ns:Employee"/> + <xsd:complexType name="User"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + <xsd:element name="age" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="User" nillable="true" type="ns:User"/> + </xsd:schema> + </types> + <message name="getEmployeeRequest"> + <part name="name" type="xsd:name"/> + </message> + <message name="getEmployeeResponse"> + <part name="employeeReturn" type="ns:ArrayOfEmployeeReturn"/> + </message> + <message name="getUserRequest"> + <part name="id" type="xsd:id"/> + </message> + <message name="getUserResponse"> + <part name="userReturn" element="ns:User"/> + </message> + <portType name="TestServerPortType"> + <operation name="getEmployee"> + <input message="tns:getEmployeeRequest"/> + <output message="tns:getEmployeeResponse"/> + </operation> + <operation name="getUser"> + <input message="tns:getUserRequest"/> + <output message="tns:getUserResponse"/> + </operation> + </portType> + <binding name="TestServerBinding" type="tns:TestServerPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="getEmployee"> + <soap:operation soapAction="http://foo.bar/testserver/#getEmployee"/> + <input> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </input> + <output> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </output> + </operation> + <operation name="getUser"> + <soap:operation soapAction="http://foo.bar/testserver/#getUser"/> + <input> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </input> + <output> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </output> + </operation> + </binding> + <service name="TestServerService"> + <port name="TestServerPort" binding="tns:TestServerBinding"> + <soap:address location="http://localhost/wsdl-creator/TestClass.php"/> + </port> + </service> +</definitions> +XML; + +file_put_contents(__DIR__ . "/bug68361.xml", $xml); +$client = new SoapClient(__DIR__ . "/bug68361.xml"); + +$res = $client->__getTypes(); // Segmentation fault here + +print_r($res); +?> +--CLEAN-- +<?php +unlink(__DIR__ . "/bug68361.xml"); +?> +--EXPECT-- +Array +( + [0] => anyType ArrayOfEmployeeReturn[] + [1] => struct Employee { + int id; + string department; + string name; + int age; +} + [2] => struct User { + string name; + int age; +} +) diff --git a/ext/sockets/tests/mcast_ipv4_send.phpt b/ext/sockets/tests/mcast_ipv4_send.phpt index ac5bce9162..0dd858f297 100644 --- a/ext/sockets/tests/mcast_ipv4_send.phpt +++ b/ext/sockets/tests/mcast_ipv4_send.phpt @@ -1,65 +1,66 @@ ---TEST--
-Multicast support: IPv4 send options
---SKIPIF--
-<?php
-if (!extension_loaded('sockets')) {
- die('skip sockets extension not available.');
-}
-if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) {
- die("skip interface 1 either doesn't exist or has no ipv4 address");
-}
---FILE--
-<?php
-$domain = AF_INET;
-$level = IPPROTO_IP;
-$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die("err");
-
-echo "Setting IP_MULTICAST_TTL\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 9);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_TTL);
-var_dump($r);
-echo "\n";
-
-echo "Setting IP_MULTICAST_LOOP\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 0);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
-var_dump($r);
-$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 1);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
-var_dump($r);
-echo "\n";
-
-echo "Setting IP_MULTICAST_IF\n";
-echo "interface 0:\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_IF, 0);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_IF);
-var_dump($r);
-echo "interface 1:\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_IF, 1);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_IF);
-var_dump($r);
-echo "\n";
-
---EXPECT--
-Setting IP_MULTICAST_TTL
-bool(true)
-int(9)
-
-Setting IP_MULTICAST_LOOP
-bool(true)
-int(0)
-bool(true)
-int(1)
-
-Setting IP_MULTICAST_IF
-interface 0:
-bool(true)
-int(0)
-interface 1:
-bool(true)
-int(1)
+--TEST-- +Multicast support: IPv4 send options +--SKIPIF-- +<?php +if (!extension_loaded('sockets')) { + die('skip sockets extension not available.'); +} +$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP) or die("err"); +if (socket_set_option($s, IPPROTO_IP, IP_MULTICAST_IF, 1) === false) { + die("skip interface 1 either doesn't exist or has no ipv4 address"); +} +--FILE-- +<?php +$domain = AF_INET; +$level = IPPROTO_IP; +$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die("err"); + +echo "Setting IP_MULTICAST_TTL\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 9); +var_dump($r); +$r = socket_get_option($s, $level, IP_MULTICAST_TTL); +var_dump($r); +echo "\n"; + +echo "Setting IP_MULTICAST_LOOP\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 0); +var_dump($r); +$r = socket_get_option($s, $level, IP_MULTICAST_LOOP); +var_dump($r); +$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 1); +var_dump($r); +$r = socket_get_option($s, $level, IP_MULTICAST_LOOP); +var_dump($r); +echo "\n"; + +echo "Setting IP_MULTICAST_IF\n"; +echo "interface 0:\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_IF, 0); +var_dump($r); +$r = socket_get_option($s, $level, IP_MULTICAST_IF); +var_dump($r); +echo "interface 1:\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_IF, 1); +var_dump($r); +$r = socket_get_option($s, $level, IP_MULTICAST_IF); +var_dump($r); +echo "\n"; + +--EXPECT-- +Setting IP_MULTICAST_TTL +bool(true) +int(9) + +Setting IP_MULTICAST_LOOP +bool(true) +int(0) +bool(true) +int(1) + +Setting IP_MULTICAST_IF +interface 0: +bool(true) +int(0) +interface 1: +bool(true) +int(1) diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h index a67e60c105..473438bb7a 100644 --- a/ext/spl/spl_engine.h +++ b/ext/spl/spl_engine.h @@ -49,6 +49,41 @@ static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval **retval, } /* }}} */ +/* {{{ spl_instantiate_arg_n */ +static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval **retval, int argc, zval ***argv TSRMLS_DC) +{ + zend_function *func = pce->constructor; + zend_fcall_info fci; + zend_fcall_info_cache fcc; + zval *dummy; + zval z_name; + + spl_instantiate(pce, retval, 0 TSRMLS_CC); + + ZVAL_STRING(&z_name, func->common.function_name, 0); + + fci.size = sizeof(zend_fcall_info); + fci.function_table = &pce->function_table; + fci.function_name = &z_name; + fci.object_ptr = *retval; + fci.symbol_table = NULL; + fci.retval_ptr_ptr = &dummy; + fci.param_count = argc; + fci.params = argv; + fci.no_separation = 1; + + fcc.initialized = 1; + fcc.function_handler = func; + fcc.calling_scope = EG(scope); + fcc.called_scope = pce; + fcc.object_ptr = *retval; + + zend_call_function(&fci, &fcc TSRMLS_CC); + + zval_ptr_dtor(&dummy); +} +/* }}} */ + #endif /* SPL_ENGINE_H */ /* diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 87a448ca64..71e03b4514 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1979,8 +1979,10 @@ SPL_METHOD(RegexIterator, accept) if (intern->current.data == NULL) { RETURN_FALSE; + } else if (Z_TYPE_P(intern->current.data) == IS_ARRAY) { + RETURN_FALSE; } - + if (intern->u.regex.flags & REGIT_USE_KEY) { subject_ptr = intern->current.key; } else { @@ -2014,8 +2016,7 @@ SPL_METHOD(RegexIterator, accept) ALLOC_INIT_ZVAL(intern->current.data); php_pcre_match_impl(intern->u.regex.pce, subject, subject_len, &zcount, intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0 TSRMLS_CC); - count = zend_hash_num_elements(Z_ARRVAL_P(intern->current.data)); - RETVAL_BOOL(count > 0); + RETVAL_BOOL(Z_LVAL(zcount) > 0); break; case REGIT_MODE_SPLIT: @@ -2193,7 +2194,7 @@ SPL_METHOD(RecursiveRegexIterator, __construct) SPL_METHOD(RecursiveRegexIterator, getChildren) { spl_dual_it_object *intern; - zval *retval, *regex; + zval *retval; if (zend_parse_parameters_none() == FAILURE) { return; @@ -2203,16 +2204,61 @@ SPL_METHOD(RecursiveRegexIterator, getChildren) zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval); if (!EG(exception)) { + zval **args[5], *object, *regex, *mode, *flags, *preg_flags; + + MAKE_STD_ZVAL(object); MAKE_STD_ZVAL(regex); + MAKE_STD_ZVAL(mode); + MAKE_STD_ZVAL(flags); + MAKE_STD_ZVAL(preg_flags); + + MAKE_COPY_ZVAL(&retval, object); ZVAL_STRING(regex, intern->u.regex.regex, 1); - spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), &return_value, 0, retval, regex TSRMLS_CC); + ZVAL_LONG(mode, intern->u.regex.mode); + ZVAL_LONG(flags, intern->u.regex.flags); + ZVAL_LONG(preg_flags, intern->u.regex.preg_flags); + + args[0] = &object; + args[1] = ®ex; + args[2] = &mode; + args[3] = &flags; + args[4] = &preg_flags; + + spl_instantiate_arg_n(Z_OBJCE_P(getThis()), &return_value, 5, args TSRMLS_CC); + + zval_ptr_dtor(&object); zval_ptr_dtor(®ex); + zval_ptr_dtor(&mode); + zval_ptr_dtor(&flags); + zval_ptr_dtor(&preg_flags); } if (retval) { zval_ptr_dtor(&retval); } } /* }}} */ +SPL_METHOD(RecursiveRegexIterator, accept) +{ + spl_dual_it_object *intern; + zval *rv; + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); + + if (intern->current.data == NULL) { + RETURN_FALSE; + } else if (Z_TYPE_P(intern->current.data) == IS_ARRAY) { + RETURN_BOOL(zend_hash_num_elements(Z_ARRVAL_P(intern->current.data)) > 0); + } + + zend_call_method_with_0_params(&(getThis()), spl_ce_RegexIterator, NULL, "accept", &rv); + + RETURN_ZVAL(rv, 1, 1); +} + #endif /* {{{ spl_dual_it_dtor */ @@ -2403,6 +2449,7 @@ ZEND_END_ARG_INFO(); static const zend_function_entry spl_funcs_RecursiveRegexIterator[] = { SPL_ME(RecursiveRegexIterator, __construct, arginfo_rec_regex_it___construct, ZEND_ACC_PUBLIC) + SPL_ME(RecursiveRegexIterator, accept, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(RecursiveFilterIterator, hasChildren, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(RecursiveRegexIterator, getChildren, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/spl/tests/bug68128.phpt b/ext/spl/tests/bug68128.phpt new file mode 100644 index 0000000000..ff41dd4931 --- /dev/null +++ b/ext/spl/tests/bug68128.phpt @@ -0,0 +1,91 @@ +--TEST-- +Bug #68128 - RecursiveRegexIterator raises "Array to string conversion" notice +--FILE-- +<?php + +$array = new ArrayIterator(array('a', array('b', 'c'))); +$regex = new RegexIterator($array, '/Array/'); + +foreach ($regex as $match) { + var_dump($match); +} + +$rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5'))); +$rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^(t)est(\d*)/', + RecursiveRegexIterator::ALL_MATCHES, 0, PREG_PATTERN_ORDER); + +foreach ($rRegexIterator as $key1 => $value1) { + + if ($rRegexIterator->hasChildren()) { + + // print all children + echo "Children: "; + foreach ($rRegexIterator->getChildren() as $key => $value) { + print_r($value); + } + echo "\n"; + } else { + echo "No children "; + print_r($value1); + echo "\n"; + } +} + +?> +--EXPECT-- +No children Array +( + [0] => Array + ( + [0] => test1 + ) + + [1] => Array + ( + [0] => t + ) + + [2] => Array + ( + [0] => 1 + ) + +) + +Children: Array +( + [0] => Array + ( + [0] => test4 + ) + + [1] => Array + ( + [0] => t + ) + + [2] => Array + ( + [0] => 4 + ) + +) +Array +( + [0] => Array + ( + [0] => test5 + ) + + [1] => Array + ( + [0] => t + ) + + [2] => Array + ( + [0] => 5 + ) + +) + diff --git a/ext/spl/tests/iterator_048.phpt b/ext/spl/tests/iterator_048.phpt index bad4e7888a..64ca97f4d6 100644 --- a/ext/spl/tests/iterator_048.phpt +++ b/ext/spl/tests/iterator_048.phpt @@ -13,11 +13,6 @@ class MyRecursiveRegexIterator extends RecursiveRegexIterator var_dump($v); } } - - function accept() - { - return $this->hasChildren() || parent::accept(); - } } $ar = new RecursiveArrayIterator(array('Foo', array('Bar'), 'FooBar', array('Baz'), 'Biz')); diff --git a/ext/spl/tests/iterator_050.phpt b/ext/spl/tests/iterator_050.phpt index fed4a3b2ee..63d8fbfa9a 100644 --- a/ext/spl/tests/iterator_050.phpt +++ b/ext/spl/tests/iterator_050.phpt @@ -46,8 +46,6 @@ array(3) { [2]=> %s(1) "2" } - -Notice: Array to string conversion in %siterator_050.php on line %d int(0) array(2) { [0]=> @@ -69,8 +67,6 @@ array(2) { [1]=> %s(1) "1" } - -Notice: Array to string conversion in %siterator_050.php on line %d object(ArrayIterator)#%d (1) { %s"storage"%s"ArrayIterator":private]=> array(9) { diff --git a/ext/spl/tests/iterator_052.phpt b/ext/spl/tests/iterator_052.phpt index c68bd5234d..84b3eb993c 100644 --- a/ext/spl/tests/iterator_052.phpt +++ b/ext/spl/tests/iterator_052.phpt @@ -46,18 +46,6 @@ var_dump($ar); <?php exit(0); ?> --EXPECTF-- bool(true) -int(0) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) int(1) array(3) { @@ -97,85 +85,11 @@ array(3) { } } bool(true) -int(3) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(4) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} - -Notice: Array to string conversion in %siterator_052.php on line %d +bool(false) bool(true) -int(5) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(6) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(7) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} -bool(true) -int(8) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) int(0) array(2) { @@ -231,67 +145,11 @@ array(2) { } } bool(true) -int(3) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} -bool(true) -int(4) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} - -Notice: Array to string conversion in %siterator_052.php on line %d bool(true) -int(5) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} +bool(false) bool(true) -int(6) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} bool(true) -int(7) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} bool(true) -int(8) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} object(ArrayIterator)#%d (1) { ["storage":"ArrayIterator":private]=> array(9) { diff --git a/ext/spl/tests/iterator_053.phpt b/ext/spl/tests/iterator_053.phpt index 5d9c740c31..b472523ab6 100644 --- a/ext/spl/tests/iterator_053.phpt +++ b/ext/spl/tests/iterator_053.phpt @@ -46,122 +46,14 @@ var_dump($ar); <?php exit(0); ?> --EXPECTF-- bool(true) -int(0) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(1) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(2) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} -bool(true) -int(3) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(4) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(5) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} +bool(false) bool(true) -int(6) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(7) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(8) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) int(0) array(2) { @@ -232,20 +124,7 @@ array(2) { string(1) "4" } } -bool(true) -int(5) -array(2) { - [0]=> - array(1) { - [0]=> - string(1) "5" - } - [1]=> - array(1) { - [0]=> - string(1) "5" - } -} +bool(false) bool(true) int(6) array(2) { diff --git a/ext/spl/tests/iterator_054.phpt b/ext/spl/tests/iterator_054.phpt index 1f1cd580c1..91266c9571 100644 --- a/ext/spl/tests/iterator_054.phpt +++ b/ext/spl/tests/iterator_054.phpt @@ -42,8 +42,6 @@ array(3) { [2]=> string(1) "3" } - -Notice: Array to string conversion in %siterator_054.php on line %d int(7) array(2) { [0]=> diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index ace6540a04..cadbb7f2e5 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4138,13 +4138,17 @@ PHP_FUNCTION(putenv) if (putenv(pe.putenv_string) == 0) { /* success */ # else error_code = SetEnvironmentVariable(pe.key, value); -# if _MSC_VER < 1500 - /* Yet another VC6 bug, unset may return env not found */ - if (error_code != 0 || - (error_code == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)) { -# else - if (error_code != 0) { /* success */ -# endif + + if (error_code != 0 +# ifndef ZTS + /* We need both SetEnvironmentVariable and _putenv here as some + dependency lib could use either way to read the environment. + Obviously the CRT version will be useful more often. But + generally, doing both brings us on the safe track at least + in NTS build. */ + && _putenv(pe.putenv_string) == 0 +# endif + ) { /* success */ # endif #endif zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len + 1, (void **) &pe, sizeof(putenv_entry), NULL); diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt index 3a9f9c31a4..a00ebf50b6 100644 --- a/ext/standard/tests/file/bug52820.phpt +++ b/ext/standard/tests/file/bug52820.phpt @@ -1,71 +1,63 @@ ---TEST--
-Bug #52820 (writes to fopencookie FILE* not committed when seeking the stream)
---SKIPIF--
-<?php
-if (!function_exists('leak_variable'))
- die("skip only for debug builds");
-/* unfortunately no standard function does a cast to FILE*, so we need
- * curl to test this */
-if (!extension_loaded("curl")) exit("skip curl extension not loaded");
-$handle=curl_init('http://127.0.0.1:37349/');
-curl_setopt($handle, CURLOPT_VERBOSE, true);
-curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
-if (!curl_setopt($handle, CURLOPT_STDERR, fopen("php://memory", "w+")))
- die("skip fopencookie not supported on this platform");
---FILE--
-<?php
-function do_stuff($url) {
- $handle=curl_init('http://127.0.0.1:37349/');
- curl_setopt($handle, CURLOPT_VERBOSE, true);
- curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($handle, CURLOPT_STDERR, $o = fopen($url, "w+"));
- curl_exec($handle);
- echo "About to rewind!\n";
- rewind($o);
- echo stream_get_contents($o);
- return $o;
-}
-
-echo "temp stream (close after):\n";
-fclose(do_stuff("php://temp"));
-
-echo "\nmemory stream (close after):\n";
-fclose(do_stuff("php://memory"));
-
-echo "\ntemp stream (leak):\n";
-leak_variable(do_stuff("php://temp"), true);
-
-echo "\nmemory stream (leak):\n";
-leak_variable(do_stuff("php://memory"), true);
-
-echo "\nDone.\n";
---EXPECTF--
-temp stream (close after):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-memory stream (close after):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-temp stream (leak):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-memory stream (leak):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-Done.
+--TEST-- +Bug #52820 (writes to fopencookie FILE* not committed when seeking the stream) +--SKIPIF-- +<?php +if (!function_exists('leak_variable')) + die("skip only for debug builds"); +/* unfortunately no standard function does a cast to FILE*, so we need + * curl to test this */ +if (!extension_loaded("curl")) exit("skip curl extension not loaded"); +$handle=curl_init('http://127.0.0.1:37349/'); +curl_setopt($handle, CURLOPT_VERBOSE, true); +curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); +if (!curl_setopt($handle, CURLOPT_STDERR, fopen("php://memory", "w+"))) + die("skip fopencookie not supported on this platform"); +--FILE-- +<?php +function do_stuff($url) { + $handle=curl_init('http://127.0.0.1:37349/'); + curl_setopt($handle, CURLOPT_VERBOSE, true); + curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); + curl_setopt($handle, CURLOPT_STDERR, $o = fopen($url, "w+")); + curl_exec($handle); + echo "About to rewind!\n"; + rewind($o); + echo stream_get_contents($o); + return $o; +} + +echo "temp stream (close after):\n"; +fclose(do_stuff("php://temp")); + +echo "\nmemory stream (close after):\n"; +fclose(do_stuff("php://memory")); + +echo "\ntemp stream (leak):\n"; +leak_variable(do_stuff("php://temp"), true); + +echo "\nmemory stream (leak):\n"; +leak_variable(do_stuff("php://memory"), true); + +echo "\nDone.\n"; +--EXPECTF-- +temp stream (close after): +About to rewind! +* %ATrying 127.0.0.1...%AConnection refused%A +* Closing connection%A%d + +memory stream (close after): +About to rewind! +* %ATrying 127.0.0.1...%AConnection refused%A +* Closing connection%A%d + +temp stream (leak): +About to rewind! +* %ATrying 127.0.0.1...%AConnection refused%A +* Closing connection%A%d + +memory stream (leak): +About to rewind! +* %ATrying 127.0.0.1...%AConnection refused%A +* Closing connection%A%d + +Done. diff --git a/ext/standard/tests/serialize/bug68044.phpt b/ext/standard/tests/serialize/bug68044.phpt new file mode 100644 index 0000000000..031e44e149 --- /dev/null +++ b/ext/standard/tests/serialize/bug68044.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #68044 Integer overflow in unserialize() (32-bits only) +--FILE-- +<?php + echo unserialize('C:3:"XYZ":18446744075857035259:{}'); +?> +===DONE== +--EXPECTF-- +Warning: Insufficient data for unserializing - %d required, 1 present in %s/bug68044.php on line 2 + +Notice: unserialize(): Error at offset 32 of 33 bytes in %s/bug68044.php on line 2 +===DONE== diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt index e0e5411036..e172061ec2 100644 --- a/ext/standard/tests/strings/url_t.phpt +++ b/ext/standard/tests/strings/url_t.phpt @@ -75,6 +75,7 @@ $sample_urls = array ( ); foreach ($sample_urls as $url) { + echo "\n--> $url: "; var_dump(@parse_url($url)); } @@ -84,21 +85,24 @@ $sample_urls = array ( } ?> --EXPECT-- -array(1) { +--> : array(1) { ["path"]=> string(0) "" } -array(1) { + +--> 64.246.30.37: array(1) { ["path"]=> string(12) "64.246.30.37" } -array(2) { + +--> http://64.246.30.37: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(12) "64.246.30.37" } -array(3) { + +--> http://64.246.30.37/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -106,11 +110,13 @@ array(3) { ["path"]=> string(1) "/" } -array(1) { + +--> 64.246.30.37/: array(1) { ["path"]=> string(13) "64.246.30.37/" } -array(3) { + +--> 64.246.30.37:80/: array(3) { ["host"]=> string(12) "64.246.30.37" ["port"]=> @@ -118,21 +124,25 @@ array(3) { ["path"]=> string(1) "/" } -array(1) { + +--> php.net: array(1) { ["path"]=> string(7) "php.net" } -array(1) { + +--> php.net/: array(1) { ["path"]=> string(8) "php.net/" } -array(2) { + +--> http://php.net: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(7) "php.net" } -array(3) { + +--> http://php.net/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -140,21 +150,25 @@ array(3) { ["path"]=> string(1) "/" } -array(1) { + +--> www.php.net: array(1) { ["path"]=> string(11) "www.php.net" } -array(1) { + +--> www.php.net/: array(1) { ["path"]=> string(12) "www.php.net/" } -array(2) { + +--> http://www.php.net: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" } -array(3) { + +--> http://www.php.net/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -162,13 +176,15 @@ array(3) { ["path"]=> string(1) "/" } -array(2) { + +--> www.php.net:80: array(2) { ["host"]=> string(11) "www.php.net" ["port"]=> int(80) } -array(3) { + +--> http://www.php.net:80: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -176,7 +192,8 @@ array(3) { ["port"]=> int(80) } -array(4) { + +--> http://www.php.net:80/: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -186,7 +203,8 @@ array(4) { ["path"]=> string(1) "/" } -array(3) { + +--> http://www.php.net/index.php: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -194,11 +212,13 @@ array(3) { ["path"]=> string(10) "/index.php" } -array(1) { + +--> www.php.net/?: array(1) { ["path"]=> string(12) "www.php.net/" } -array(3) { + +--> www.php.net:80/?: array(3) { ["host"]=> string(11) "www.php.net" ["port"]=> @@ -206,7 +226,8 @@ array(3) { ["path"]=> string(1) "/" } -array(3) { + +--> http://www.php.net/?: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -214,7 +235,8 @@ array(3) { ["path"]=> string(1) "/" } -array(4) { + +--> http://www.php.net:80/?: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -224,7 +246,8 @@ array(4) { ["path"]=> string(1) "/" } -array(4) { + +--> http://www.php.net:80/index.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -234,7 +257,8 @@ array(4) { ["path"]=> string(10) "/index.php" } -array(4) { + +--> http://www.php.net:80/foo/bar/index.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -244,7 +268,8 @@ array(4) { ["path"]=> string(18) "/foo/bar/index.php" } -array(4) { + +--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -254,7 +279,8 @@ array(4) { ["path"]=> string(53) "/this/is/a/very/deep/directory/structure/and/file.php" } -array(5) { + +--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -266,7 +292,8 @@ array(5) { ["query"]=> string(37) "lots=1&of=2¶meters=3&too=4&here=5" } -array(4) { + +--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -276,7 +303,8 @@ array(4) { ["path"]=> string(45) "/this/is/a/very/deep/directory/structure/and/" } -array(4) { + +--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -286,7 +314,8 @@ array(4) { ["path"]=> string(53) "/this/is/a/very/deep/directory/structure/and/file.php" } -array(4) { + +--> http://www.php.net:80/this/../a/../deep/directory: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -296,7 +325,8 @@ array(4) { ["path"]=> string(28) "/this/../a/../deep/directory" } -array(4) { + +--> http://www.php.net:80/this/../a/../deep/directory/: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -306,7 +336,8 @@ array(4) { ["path"]=> string(29) "/this/../a/../deep/directory/" } -array(4) { + +--> http://www.php.net:80/this/is/a/very/deep/directory/../file.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -316,7 +347,8 @@ array(4) { ["path"]=> string(42) "/this/is/a/very/deep/directory/../file.php" } -array(4) { + +--> http://www.php.net:80/index.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -326,7 +358,8 @@ array(4) { ["path"]=> string(10) "/index.php" } -array(4) { + +--> http://www.php.net:80/index.php?: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -336,7 +369,8 @@ array(4) { ["path"]=> string(10) "/index.php" } -array(5) { + +--> http://www.php.net:80/#foo: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -348,7 +382,8 @@ array(5) { ["fragment"]=> string(3) "foo" } -array(4) { + +--> http://www.php.net:80/?#: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -358,7 +393,8 @@ array(4) { ["path"]=> string(1) "/" } -array(5) { + +--> http://www.php.net:80/?test=1: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -370,7 +406,8 @@ array(5) { ["query"]=> string(6) "test=1" } -array(4) { + +--> http://www.php.net/?test=1&: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -380,7 +417,8 @@ array(4) { ["query"]=> string(7) "test=1&" } -array(5) { + +--> http://www.php.net:80/?&: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -392,7 +430,8 @@ array(5) { ["query"]=> string(1) "&" } -array(5) { + +--> http://www.php.net:80/index.php?test=1&: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -404,7 +443,8 @@ array(5) { ["query"]=> string(7) "test=1&" } -array(4) { + +--> http://www.php.net/index.php?&: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -414,7 +454,8 @@ array(4) { ["query"]=> string(1) "&" } -array(5) { + +--> http://www.php.net:80/index.php?foo&: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -426,7 +467,8 @@ array(5) { ["query"]=> string(4) "foo&" } -array(4) { + +--> http://www.php.net/index.php?&foo: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -436,7 +478,8 @@ array(4) { ["query"]=> string(4) "&foo" } -array(5) { + +--> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -448,7 +491,8 @@ array(5) { ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" } -array(5) { + +--> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(5) { ["host"]=> string(11) "www.php.net" ["port"]=> @@ -460,7 +504,8 @@ array(5) { ["fragment"]=> string(16) "some_page_ref123" } -array(7) { + +--> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> @@ -476,13 +521,16 @@ array(7) { ["fragment"]=> string(16) "some_page_ref123" } -array(6) { + +--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["user"]=> string(6) "secret" + ["pass"]=> + string(0) "" ["path"]=> string(10) "/index.php" ["query"]=> @@ -490,13 +538,16 @@ array(6) { ["fragment"]=> string(16) "some_page_ref123" } -array(7) { + +--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) + ["user"]=> + string(0) "" ["pass"]=> string(7) "hideout" ["path"]=> @@ -506,7 +557,8 @@ array(7) { ["fragment"]=> string(16) "some_page_ref123" } -array(7) { + +--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> @@ -522,7 +574,8 @@ array(7) { ["fragment"]=> string(16) "some_page_ref123" } -array(7) { + +--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> @@ -538,7 +591,8 @@ array(7) { ["fragment"]=> string(16) "some_page_ref123" } -array(8) { + +--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { ["scheme"]=> string(4) "http" ["host"]=> @@ -556,13 +610,15 @@ array(8) { ["fragment"]=> string(16) "some_page_ref123" } -array(2) { + +--> nntp://news.php.net: array(2) { ["scheme"]=> string(4) "nntp" ["host"]=> string(12) "news.php.net" } -array(3) { + +--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz: array(3) { ["scheme"]=> string(3) "ftp" ["host"]=> @@ -570,25 +626,29 @@ array(3) { ["path"]=> string(22) "/gnu/glic/glibc.tar.gz" } -array(2) { + +--> zlib:http://foo@bar: array(2) { ["scheme"]=> string(4) "zlib" ["path"]=> string(14) "http://foo@bar" } -array(2) { + +--> zlib:filename.txt: array(2) { ["scheme"]=> string(4) "zlib" ["path"]=> string(12) "filename.txt" } -array(2) { + +--> zlib:/path/to/my/file/file.txt: array(2) { ["scheme"]=> string(4) "zlib" ["path"]=> string(25) "/path/to/my/file/file.txt" } -array(3) { + +--> foo://foo@bar: array(3) { ["scheme"]=> string(3) "foo" ["host"]=> @@ -596,25 +656,29 @@ array(3) { ["user"]=> string(3) "foo" } -array(2) { + +--> mailto:me@mydomain.com: array(2) { ["scheme"]=> string(6) "mailto" ["path"]=> string(15) "me@mydomain.com" } -array(2) { + +--> /foo.php?a=b&c=d: array(2) { ["path"]=> string(8) "/foo.php" ["query"]=> string(7) "a=b&c=d" } -array(2) { + +--> foo.php?a=b&c=d: array(2) { ["path"]=> string(7) "foo.php" ["query"]=> string(7) "a=b&c=d" } -array(6) { + +--> http://user:passwd@www.example.com:8080?bar=1&boom=0: array(6) { ["scheme"]=> string(4) "http" ["host"]=> @@ -628,13 +692,15 @@ array(6) { ["query"]=> string(12) "bar=1&boom=0" } -array(2) { + +--> file:///path/to/file: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(13) "/path/to/file" } -array(3) { + +--> file://path/to/file: array(3) { ["scheme"]=> string(4) "file" ["host"]=> @@ -642,13 +708,15 @@ array(3) { ["path"]=> string(8) "/to/file" } -array(2) { + +--> file:/path/to/file: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(13) "/path/to/file" } -array(4) { + +--> http://1.2.3.4:/abc.asp?a=1&b=2: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -658,7 +726,8 @@ array(4) { ["query"]=> string(7) "a=1&b=2" } -array(3) { + +--> http://foo.com#bar: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -666,11 +735,13 @@ array(3) { ["fragment"]=> string(3) "bar" } -array(1) { + +--> scheme:: array(1) { ["scheme"]=> string(6) "scheme" } -array(4) { + +--> foo+bar://baz@bang/bla: array(4) { ["scheme"]=> string(7) "foo+bar" ["host"]=> @@ -680,13 +751,15 @@ array(4) { ["path"]=> string(4) "/bla" } -array(2) { + +--> gg:9130731: array(2) { ["scheme"]=> string(2) "gg" ["path"]=> string(7) "9130731" } -array(7) { + +--> http://user:@pass@host/path?argument?value#etc: array(7) { ["scheme"]=> string(4) "http" ["host"]=> @@ -710,3 +783,4 @@ string(7) "hideout" string(10) "/index.php" string(31) "test=1&test2=char&test3=mixesCI" string(16) "some_page_ref123" + diff --git a/ext/standard/tests/url/parse_url_basic_001.phpt b/ext/standard/tests/url/parse_url_basic_001.phpt index a6f4f7a252..0708691fe3 100644 --- a/ext/standard/tests/url/parse_url_basic_001.phpt +++ b/ext/standard/tests/url/parse_url_basic_001.phpt @@ -454,13 +454,15 @@ echo "Done"; string(16) "some_page_ref123" } ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(6) { +--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["user"]=> string(6) "secret" + ["pass"]=> + string(0) "" ["path"]=> string(10) "/index.php" ["query"]=> @@ -469,13 +471,15 @@ echo "Done"; string(16) "some_page_ref123" } ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { +--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) + ["user"]=> + string(0) "" ["pass"]=> string(7) "hideout" ["path"]=> diff --git a/ext/standard/tests/url/parse_url_basic_005.phpt b/ext/standard/tests/url/parse_url_basic_005.phpt index 1fc946e5b3..5b2cb98f8b 100644 --- a/ext/standard/tests/url/parse_url_basic_005.phpt +++ b/ext/standard/tests/url/parse_url_basic_005.phpt @@ -66,7 +66,7 @@ echo "Done"; --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL +--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(0) "" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(14) "secret@hideout" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" diff --git a/ext/standard/tests/url/parse_url_basic_006.phpt b/ext/standard/tests/url/parse_url_basic_006.phpt index 5104326198..79af6b8b62 100644 --- a/ext/standard/tests/url/parse_url_basic_006.phpt +++ b/ext/standard/tests/url/parse_url_basic_006.phpt @@ -65,7 +65,7 @@ echo "Done"; --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL +--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(0) "" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL diff --git a/ext/standard/url.c b/ext/standard/url.c index fe1b2fe112..06c72e483f 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -240,16 +240,12 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) /* check for login and password */ if ((p = zend_memrchr(s, '@', (e-s)))) { if ((pp = memchr(s, ':', (p-s)))) { - if ((pp-s) > 0) { - ret->user = estrndup(s, (pp-s)); - php_replace_controlchars_ex(ret->user, (pp - s)); - } + ret->user = estrndup(s, (pp-s)); + php_replace_controlchars_ex(ret->user, (pp - s)); pp++; - if (p-pp > 0) { - ret->pass = estrndup(pp, (p-pp)); - php_replace_controlchars_ex(ret->pass, (p-pp)); - } + ret->pass = estrndup(pp, (p-pp)); + php_replace_controlchars_ex(ret->pass, (p-pp)); } else { ret->user = estrndup(s, (p-s)); php_replace_controlchars_ex(ret->user, (p-s)); diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 657051f6f7..8129da3d82 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sat Jun 21 21:27:56 2014 */ +/* Generated by re2c 0.13.5 */ #line 1 "ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ @@ -372,7 +372,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) (*p) += 2; - if (datalen < 0 || (*p) + datalen >= max) { + if (datalen < 0 || (max - (*p)) <= datalen) { zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p))); return 0; } diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 130750805f..6de158392e 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -376,7 +376,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) (*p) += 2; - if (datalen < 0 || (*p) + datalen >= max) { + if (datalen < 0 || (max - (*p)) <= datalen) { zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p))); return 0; } diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c index ce70c2afd9..f184cf49ee 100644 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.c +++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c @@ -201,9 +201,13 @@ static int date_from_ISO8601 (const char *text, time_t * value) { } p++; } - text = buf; + *p2 = 0; + text = buf; } + if (strlen(text)<17) { + return -1; + } tm.tm_isdst = -1; @@ -219,16 +223,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_mon = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+4]) tm.tm_mon += (text[i+4]-'0')*n; n /= 10; } tm.tm_mon --; + if(tm.tm_mon < 0 || tm.tm_mon > 11) { + return -1; + } n = 10; tm.tm_mday = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+6]) tm.tm_mday += (text[i+6]-'0')*n; n /= 10; } @@ -236,7 +243,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_hour = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+9]) tm.tm_hour += (text[i+9]-'0')*n; n /= 10; } @@ -244,7 +251,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_min = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+12]) tm.tm_min += (text[i+12]-'0')*n; n /= 10; } @@ -252,7 +259,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_sec = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+15]) tm.tm_sec += (text[i+15]-'0')*n; n /= 10; } diff --git a/ext/xmlrpc/tests/bug68027.phpt b/ext/xmlrpc/tests/bug68027.phpt new file mode 100644 index 0000000000..a5c96f1cf2 --- /dev/null +++ b/ext/xmlrpc/tests/bug68027.phpt @@ -0,0 +1,44 @@ +--TEST-- +Bug #68027 (buffer overflow in mkgmtime() function) +--SKIPIF-- +<?php +if (!extension_loaded("xmlrpc")) print "skip"; +?> +--FILE-- +<?php + +$d = '6-01-01 20:00:00'; +xmlrpc_set_type($d, 'datetime'); +var_dump($d); +$datetime = "2001-0-08T21:46:40-0400"; +$obj = xmlrpc_decode("<?xml version=\"1.0\"?><methodResponse><params><param><value><dateTime.iso8601>$datetime</dateTime.iso8601></value></param></params></methodResponse>"); +print_r($obj); + +$datetime = "34770-0-08T21:46:40-0400"; +$obj = xmlrpc_decode("<?xml version=\"1.0\"?><methodResponse><params><param><value><dateTime.iso8601>$datetime</dateTime.iso8601></value></param></params></methodResponse>"); +print_r($obj); + +echo "Done\n"; +?> +--EXPECTF-- +object(stdClass)#1 (3) { + ["scalar"]=> + string(16) "6-01-01 20:00:00" + ["xmlrpc_type"]=> + string(8) "datetime" + ["timestamp"]=> + int(%d) +} +stdClass Object +( + [scalar] => 2001-0-08T21:46:40-0400 + [xmlrpc_type] => datetime + [timestamp] => %s +) +stdClass Object +( + [scalar] => 34770-0-08T21:46:40-0400 + [xmlrpc_type] => datetime + [timestamp] => %d +) +Done diff --git a/ext/zlib/tests/gzfile_variation4.phpt b/ext/zlib/tests/gzfile_variation4.phpt index 3310231566..9b3128125a 100644 --- a/ext/zlib/tests/gzfile_variation4.phpt +++ b/ext/zlib/tests/gzfile_variation4.phpt @@ -2,7 +2,7 @@ Test function gzfile() by substituting argument 1 with float values. --SKIPIF-- <?php -if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build'); +if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); ?> --FILE-- <?php diff --git a/ext/zlib/tests/readgzfile_variation4.phpt b/ext/zlib/tests/readgzfile_variation4.phpt index 00211f7dfe..32f434cba2 100644 --- a/ext/zlib/tests/readgzfile_variation4.phpt +++ b/ext/zlib/tests/readgzfile_variation4.phpt @@ -2,7 +2,7 @@ Test function readgzfile() by substituting argument 1 with float values. --SKIPIF-- <?php -if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build'); +if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); ?> --FILE-- <?php diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 705fb5dd5f..25804597bc 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -34,6 +34,18 @@ #include "ext/standard/php_string.h" #include "php_zlib.h" +/* + * zlib include files can define the following preprocessor defines which rename + * the corresponding PHP functions to gzopen64, gzseek64 and gztell64 and thereby + * breaking some software, most notably PEAR's Archive_Tar, which halts execution + * without error message on gzip compressed archivesa. + * + * This only seems to happen on 32bit systems with large file support. + */ +#undef gzopen +#undef gzseek +#undef gztell + ZEND_DECLARE_MODULE_GLOBALS(zlib); /* {{{ Memory management wrappers */ diff --git a/main/getopt.c b/main/getopt.c index a31a6c75d5..258173fc22 100644 --- a/main/getopt.c +++ b/main/getopt.c @@ -59,9 +59,17 @@ PHPAPI int php_getopt(int argc, char* const *argv, const opt_struct opts[], char { static int optchr = 0; static int dash = 0; /* have already seen the - */ + static char **prev_optarg = NULL; php_optidx = -1; + if(prev_optarg && prev_optarg != optarg) { + /* reset the state */ + optchr = 0; + dash = 0; + } + prev_optarg = optarg; + if (*optind >= argc) { return(EOF); } diff --git a/main/php_version.h b/main/php_version.h index e7478d5ce6..3e5d9d8b3e 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 5 -#define PHP_RELEASE_VERSION 18 +#define PHP_RELEASE_VERSION 20 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "5.5.18-dev" -#define PHP_VERSION_ID 50518 +#define PHP_VERSION "5.5.20-dev" +#define PHP_VERSION_ID 50520 diff --git a/php.ini-development b/php.ini-development index 7e640ad7a9..726e3025aa 100644 --- a/php.ini-development +++ b/php.ini-development @@ -293,20 +293,17 @@ serialize_precision = 17 ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory -; or per-virtualhost web server configuration file. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; or per-virtualhost web server configuration file. ; http://php.net/open-basedir ;open_basedir = ; This directive allows you to disable certain functions for security reasons. -; It receives a comma-delimited list of function names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; It receives a comma-delimited list of function names. ; http://php.net/disable-functions disable_functions = ; This directive allows you to disable certain classes for security reasons. -; It receives a comma-delimited list of class names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; It receives a comma-delimited list of class names. ; http://php.net/disable-classes disable_classes = @@ -1005,7 +1002,7 @@ smtp_port = 25 ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of -; the 5th parameter to mail(), even in safe mode. +; the 5th parameter to mail(). ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename diff --git a/php.ini-production b/php.ini-production index 74e7ceb761..7cdd069c44 100644 --- a/php.ini-production +++ b/php.ini-production @@ -293,20 +293,17 @@ serialize_precision = 17 ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory -; or per-virtualhost web server configuration file. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; or per-virtualhost web server configuration file. ; http://php.net/open-basedir ;open_basedir = ; This directive allows you to disable certain functions for security reasons. -; It receives a comma-delimited list of function names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; It receives a comma-delimited list of function names. ; http://php.net/disable-functions disable_functions = ; This directive allows you to disable certain classes for security reasons. -; It receives a comma-delimited list of class names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; It receives a comma-delimited list of class names. ; http://php.net/disable-classes disable_classes = @@ -1005,7 +1002,7 @@ smtp_port = 25 ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of -; the 5th parameter to mail(), even in safe mode. +; the 5th parameter to mail(). ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename diff --git a/run-tests.php b/run-tests.php index cc20febf71..5563385ddf 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2714,7 +2714,7 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag if (is_array($type)) { $output_type = $type[0] . 'ED'; - $temp = array_intersect(array('XFAIL', 'FAIL'), $type); + $temp = array_intersect(array('XFAIL', 'FAIL', 'WARN'), $type); $type = reset($temp); } else { $output_type = $type . 'ED'; @@ -2728,6 +2728,9 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag } elseif ('SKIP' == $type) { junit_suite_record($suite, 'test_skip'); $JUNIT['files'][$file_name]['xml'] .= "<skipped>$escaped_message</skipped>\n"; + } elseif ('WARN' == $type) { + junit_suite_record($suite, 'test_warn'); + $JUNIT['files'][$file_name]['xml'] .= "<warning>$escaped_message</warning>\n"; } elseif('FAIL' == $type) { junit_suite_record($suite, 'test_fail'); $JUNIT['files'][$file_name]['xml'] .= "<failure type='$output_type' message='$escaped_message'>$escaped_details</failure>\n"; diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c index d77b6f8ca7..d2764a59b7 100644 --- a/sapi/fpm/fpm/fastcgi.c +++ b/sapi/fpm/fpm/fastcgi.c @@ -137,13 +137,14 @@ typedef union _sa_t { struct sockaddr sa; struct sockaddr_un sa_unix; struct sockaddr_in sa_inet; + struct sockaddr_in6 sa_inet6; } sa_t; static HashTable fcgi_mgmt_vars; static int is_initialized = 0; static int in_shutdown = 0; -static in_addr_t *allowed_clients = NULL; +static sa_t *allowed_clients = NULL; static sa_t client_sa; @@ -266,15 +267,23 @@ void fcgi_set_allowed_clients(char *ip) *end = 0; end++; } - allowed_clients[n] = inet_addr(cur); - if (allowed_clients[n] == INADDR_NONE) { + if (inet_pton(AF_INET, cur, &allowed_clients[n].sa_inet.sin_addr)>0) { + allowed_clients[n].sa.sa_family = AF_INET; + n++; + } else if (inet_pton(AF_INET6, cur, &allowed_clients[n].sa_inet6.sin6_addr)>0) { + allowed_clients[n].sa.sa_family = AF_INET6; + n++; + } else { zlog(ZLOG_ERROR, "Wrong IP address '%s' in listen.allowed_clients", cur); } - n++; cur = end; } - allowed_clients[n] = INADDR_NONE; + allowed_clients[n].sa.sa_family = 0; free(ip); + if (!n) { + zlog(ZLOG_ERROR, "There are no allowed addresses for this pool"); + /* don't clear allowed_clients as it will create an "open for all" security issue */ + } } } @@ -759,6 +768,43 @@ void fcgi_close(fcgi_request *req, int force, int destroy) } } +static int fcgi_is_allowed() { + int i; + + if (client_sa.sa.sa_family == AF_UNIX) { + return 1; + } + if (!allowed_clients) { + return 1; + } + if (client_sa.sa.sa_family == AF_INET) { + for (i=0 ; allowed_clients[i].sa.sa_family ; i++) { + if (allowed_clients[i].sa.sa_family == AF_INET + && !memcmp(&client_sa.sa_inet.sin_addr, &allowed_clients[i].sa_inet.sin_addr, 4)) { + return 1; + } + } + } + if (client_sa.sa.sa_family == AF_INET6) { + for (i=0 ; allowed_clients[i].sa.sa_family ; i++) { + if (allowed_clients[i].sa.sa_family == AF_INET6 + && !memcmp(&client_sa.sa_inet6.sin6_addr, &allowed_clients[i].sa_inet6.sin6_addr, 12)) { + return 1; + } +#ifdef IN6_IS_ADDR_V4MAPPED + if (allowed_clients[i].sa.sa_family == AF_INET + && IN6_IS_ADDR_V4MAPPED(&client_sa.sa_inet6.sin6_addr) + && !memcmp(((char *)&client_sa.sa_inet6.sin6_addr)+12, &allowed_clients[i].sa_inet.sin_addr, 4)) { + return 1; + } +#endif + } + } + + zlog(ZLOG_ERROR, "Connection disallowed: IP address '%s' has been dropped.", fcgi_get_last_client_ip()); + return 0; +} + int fcgi_accept_request(fcgi_request *req) { #ifdef _WIN32 @@ -809,23 +855,10 @@ int fcgi_accept_request(fcgi_request *req) FCGI_UNLOCK(req->listen_socket); client_sa = sa; - if (sa.sa.sa_family == AF_INET && req->fd >= 0 && allowed_clients) { - int n = 0; - int allowed = 0; - - while (allowed_clients[n] != INADDR_NONE) { - if (allowed_clients[n] == sa.sa_inet.sin_addr.s_addr) { - allowed = 1; - break; - } - n++; - } - if (!allowed) { - zlog(ZLOG_ERROR, "Connection disallowed: IP address '%s' has been dropped.", inet_ntoa(sa.sa_inet.sin_addr)); - closesocket(req->fd); - req->fd = -1; - continue; - } + if (req->fd >= 0 && !fcgi_is_allowed()) { + closesocket(req->fd); + req->fd = -1; + continue; } } @@ -1094,12 +1127,27 @@ void fcgi_free_mgmt_var_cb(void * ptr) pefree(*var, 1); } -char *fcgi_get_last_client_ip() /* {{{ */ +const char *fcgi_get_last_client_ip() /* {{{ */ { - if (client_sa.sa.sa_family == AF_UNIX) { - return NULL; + static char str[INET6_ADDRSTRLEN]; + + /* Ipv4 */ + if (client_sa.sa.sa_family == AF_INET) { + return inet_ntop(client_sa.sa.sa_family, &client_sa.sa_inet.sin_addr, str, INET6_ADDRSTRLEN); + } +#ifdef IN6_IS_ADDR_V4MAPPED + /* Ipv4-Mapped-Ipv6 */ + if (client_sa.sa.sa_family == AF_INET6 + && IN6_IS_ADDR_V4MAPPED(&client_sa.sa_inet6.sin6_addr)) { + return inet_ntop(AF_INET, ((char *)&client_sa.sa_inet6.sin6_addr)+12, str, INET6_ADDRSTRLEN); } - return inet_ntoa(client_sa.sa_inet.sin_addr); +#endif + /* Ipv6 */ + if (client_sa.sa.sa_family == AF_INET6) { + return inet_ntop(client_sa.sa.sa_family, &client_sa.sa_inet6.sin6_addr, str, INET6_ADDRSTRLEN); + } + /* Unix socket */ + return NULL; } /* }}} */ /* diff --git a/sapi/fpm/fpm/fastcgi.h b/sapi/fpm/fpm/fastcgi.h index 34f9eef9da..f5cfe9f66a 100644 --- a/sapi/fpm/fpm/fastcgi.h +++ b/sapi/fpm/fpm/fastcgi.h @@ -133,7 +133,7 @@ int fcgi_flush(fcgi_request *req, int close); void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, size_t value_len); void fcgi_free_mgmt_var_cb(void * ptr); -char *fcgi_get_last_client_ip(); +const char *fcgi_get_last_client_ip(); /* * Local variables: diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c index 103a830389..ceee2dd790 100644 --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c @@ -813,7 +813,7 @@ static int fpm_conf_process_all_pools() /* {{{ */ if (config->pm_start_servers <= 0) { config->pm_start_servers = config->pm_min_spare_servers + ((config->pm_max_spare_servers - config->pm_min_spare_servers) / 2); - zlog(ZLOG_WARNING, "[pool %s] pm.start_servers is not set. It's been set to %d.", wp->config->name, config->pm_start_servers); + zlog(ZLOG_NOTICE, "[pool %s] pm.start_servers is not set. It's been set to %d.", wp->config->name, config->pm_start_servers); } else if (config->pm_start_servers < config->pm_min_spare_servers || config->pm_start_servers > config->pm_max_spare_servers) { zlog(ZLOG_ALERT, "[pool %s] pm.start_servers(%d) must not be less than pm.min_spare_servers(%d) and not greater than pm.max_spare_servers(%d)", wp->config->name, config->pm_start_servers, config->pm_min_spare_servers, config->pm_max_spare_servers); @@ -1153,6 +1153,7 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */ } fpm_globals.log_level = fpm_global_config.log_level; + zlog_set_level(fpm_globals.log_level); if (fpm_global_config.process_max < 0) { zlog(ZLOG_ERROR, "process_max can't be negative"); @@ -1193,15 +1194,15 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */ return -1; } - if (0 > fpm_log_open(0)) { + if (0 > fpm_event_pre_init(fpm_global_config.events_mechanism)) { return -1; } - if (0 > fpm_event_pre_init(fpm_global_config.events_mechanism)) { + if (0 > fpm_conf_process_all_pools()) { return -1; } - if (0 > fpm_conf_process_all_pools()) { + if (0 > fpm_log_open(0)) { return -1; } @@ -1250,7 +1251,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ * #ifdef HAVE_GLOB { g.gl_offs = 0; - if ((i = glob(inc, GLOB_ERR | GLOB_MARK | GLOB_NOSORT, NULL, &g)) != 0) { + if ((i = glob(inc, GLOB_ERR | GLOB_MARK, NULL, &g)) != 0) { #ifdef GLOB_NOMATCH if (i == GLOB_NOMATCH) { zlog(ZLOG_WARNING, "Nothing matches the include pattern '%s' from %s at line %d.", inc, filename, ini_lineno); diff --git a/sapi/fpm/fpm/fpm_log.c b/sapi/fpm/fpm/fpm_log.c index 4e1a057db1..b0bf32ac16 100644 --- a/sapi/fpm/fpm/fpm_log.c +++ b/sapi/fpm/fpm/fpm_log.c @@ -46,6 +46,8 @@ int fpm_log_open(int reopen) /* {{{ */ if (0 > fd) { zlog(ZLOG_SYSERROR, "failed to open access log (%s)", wp->config->access_log); return -1; + } else { + zlog(ZLOG_DEBUG, "open access log (%s)", wp->config->access_log); } if (reopen) { @@ -367,7 +369,7 @@ int fpm_log_write(char *log_format TSRMLS_DC) /* {{{ */ case 'R': /* remote IP address */ if (!test) { - char *tmp = fcgi_get_last_client_ip(); + const char *tmp = fcgi_get_last_client_ip(); len2 = snprintf(b, FPM_LOG_BUFFER - len, "%s", tmp ? tmp : "-"); } break; diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c index e056565ea4..0286f0eee8 100644 --- a/sapi/fpm/fpm/fpm_sockets.c +++ b/sapi/fpm/fpm/fpm_sockets.c @@ -39,29 +39,6 @@ struct listening_socket_s { static struct fpm_array_s sockets_list; -static int fpm_sockets_resolve_af_inet(char *node, char *service, struct sockaddr_in *addr) /* {{{ */ -{ - struct addrinfo *res; - struct addrinfo hints; - int ret; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_INET; - ret = getaddrinfo(node, service, &hints, &res); - - if (ret != 0) { - zlog(ZLOG_ERROR, "can't resolve hostname '%s%s%s': getaddrinfo said: %s%s%s\n", - node, service ? ":" : "", service ? service : "", - gai_strerror(ret), ret == EAI_SYSTEM ? ", system error: " : "", ret == EAI_SYSTEM ? strerror(errno) : ""); - return -1; - } - - *addr = *(struct sockaddr_in *) res->ai_addr; - freeaddrinfo(res); - return 0; -} -/* }}} */ - enum { FPM_GET_USE_SOCKET = 1, FPM_STORE_SOCKET = 2, FPM_STORE_USE_SOCKET = 3 }; static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */ @@ -98,14 +75,34 @@ static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */ } /* }}} */ +static void *fpm_get_in_addr(struct sockaddr *sa) /* {{{ */ +{ + if (sa->sa_family == AF_INET) { + return &(((struct sockaddr_in*)sa)->sin_addr); + } + + return &(((struct sockaddr_in6*)sa)->sin6_addr); +} +/* }}} */ + +static int fpm_get_in_port(struct sockaddr *sa) /* {{{ */ +{ + if (sa->sa_family == AF_INET) { + return ntohs(((struct sockaddr_in*)sa)->sin_port); + } + + return ntohs(((struct sockaddr_in6*)sa)->sin6_port); +} +/* }}} */ + static int fpm_sockets_hash_op(int sock, struct sockaddr *sa, char *key, int type, int op) /* {{{ */ { if (key == NULL) { switch (type) { case FPM_AF_INET : { - struct sockaddr_in *sa_in = (struct sockaddr_in *) sa; - key = alloca(sizeof("xxx.xxx.xxx.xxx:ppppp")); - sprintf(key, "%u.%u.%u.%u:%u", IPQUAD(&sa_in->sin_addr), (unsigned int) ntohs(sa_in->sin_port)); + key = alloca(INET6_ADDRSTRLEN+10); + inet_ntop(sa->sa_family, fpm_get_in_addr(sa), key, INET6_ADDRSTRLEN); + sprintf(key+strlen(key), ":%d", fpm_get_in_port(sa)); break; } @@ -254,11 +251,15 @@ enum fpm_address_domain fpm_sockets_domain_from_address(char *address) /* {{{ */ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /* {{{ */ { - struct sockaddr_in sa_in; + struct addrinfo hints, *servinfo, *p; char *dup_address = strdup(wp->config->listen_address); - char *port_str = strchr(dup_address, ':'); + char *port_str = strrchr(dup_address, ':'); char *addr = NULL; + char tmpbuf[INET6_ADDRSTRLEN]; + int addr_len; int port = 0; + int sock = -1; + int status; if (port_str) { /* this is host:port pair */ *port_str++ = '\0'; @@ -274,23 +275,49 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /* return -1; } - memset(&sa_in, 0, sizeof(sa_in)); + if (!addr) { + /* no address: default documented behavior, all IPv4 addresses */ + struct sockaddr_in sa_in; - if (addr) { - sa_in.sin_addr.s_addr = inet_addr(addr); - if (sa_in.sin_addr.s_addr == INADDR_NONE) { /* do resolve */ - if (0 > fpm_sockets_resolve_af_inet(addr, NULL, &sa_in)) { - return -1; + memset(&sa_in, 0, sizeof(sa_in)); + sa_in.sin_family = AF_INET; + sa_in.sin_port = htons(port); + sa_in.sin_addr.s_addr = htonl(INADDR_ANY); + free(dup_address); + return fpm_sockets_get_listening_socket(wp, (struct sockaddr *) &sa_in, sizeof(struct sockaddr_in)); + } + + /* strip brackets from address for getaddrinfo */ + addr_len = strlen(addr); + if (addr[0] == '[' && addr[addr_len - 1] == ']') { + addr[addr_len - 1] = '\0'; + addr++; + } + + memset(&hints, 0, sizeof hints); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + + if ((status = getaddrinfo(addr, port_str, &hints, &servinfo)) != 0) { + zlog(ZLOG_ERROR, "getaddrinfo: %s\n", gai_strerror(status)); + return -1; + } + + for (p = servinfo; p != NULL; p = p->ai_next) { + inet_ntop(p->ai_family, fpm_get_in_addr(p->ai_addr), tmpbuf, INET6_ADDRSTRLEN); + if (sock < 0) { + if ((sock = fpm_sockets_get_listening_socket(wp, p->ai_addr, p->ai_addrlen)) != -1) { + zlog(ZLOG_DEBUG, "Found address for %s, socket opened on %s", dup_address, tmpbuf); } - zlog(ZLOG_NOTICE, "address '%s' resolved as %u.%u.%u.%u", addr, IPQUAD(&sa_in.sin_addr)); + } else { + zlog(ZLOG_WARNING, "Found multiple addresses for %s, %s ignored", dup_address, tmpbuf); } - } else { - sa_in.sin_addr.s_addr = htonl(INADDR_ANY); } - sa_in.sin_family = AF_INET; - sa_in.sin_port = htons(port); + free(dup_address); - return fpm_sockets_get_listening_socket(wp, (struct sockaddr *) &sa_in, sizeof(struct sockaddr_in)); + freeaddrinfo(servinfo); + + return sock; } /* }}} */ diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h index 121c016a7b..446c78e410 100644 --- a/sapi/fpm/fpm/fpm_sockets.h +++ b/sapi/fpm/fpm/fpm_sockets.h @@ -45,10 +45,4 @@ static inline int fd_set_blocked(int fd, int blocked) /* {{{ */ } /* }}} */ -#define IPQUAD(sin_addr) \ - (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[0], \ - (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[1], \ - (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[2], \ - (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[3] - #endif diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c index ea0e67369c..7ce2bcc6e6 100644 --- a/sapi/fpm/fpm/fpm_unix.c +++ b/sapi/fpm/fpm/fpm_unix.c @@ -361,7 +361,6 @@ int fpm_unix_init_main() /* {{{ */ } } - zlog_set_level(fpm_globals.log_level); return 0; } /* }}} */ diff --git a/sapi/fpm/php-fpm.8.in b/sapi/fpm/php-fpm.8.in index b02aa25ba7..f6ad963aed 100644 --- a/sapi/fpm/php-fpm.8.in +++ b/sapi/fpm/php-fpm.8.in @@ -84,6 +84,13 @@ Version number Specify alternative prefix path (the default is @php_fpm_prefix@) .TP .PD 0 +.B \-\-pid \fIfile\fP +.TP +.PD 1 +.B \-g +Specify the PID file location. +.TP +.PD 0 .B \-\-fpm\-config \fIfile\fP .TP .PD 1 @@ -113,12 +120,11 @@ Force to run in background and ignore daemonize option from configuration file. Force to stay in foreground and ignore daemonize option from configuration file. .TP .PD 0 -.B \-\-zend\-extension \fIfile\fP +.B \-\-allow\-to\-run\-as\-root .TP .PD 1 -.B \-z \fIfile\fP -Load Zend extension -.IR file +.B \-R +Allow pool to run as root (disabled by default) .SH FILES .TP 15 .B php-fpm.conf diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in index c5f4abc59c..833a4f4f8c 100644 --- a/sapi/fpm/php-fpm.conf.in +++ b/sapi/fpm/php-fpm.conf.in @@ -131,6 +131,7 @@ ; Per pool prefix ; It only applies on the following directives: +; - 'access.log' ; - 'slowlog' ; - 'listen' (unixsocket) ; - 'chroot' @@ -150,10 +151,14 @@ group = @php_fpm_group@ ; The address on which to accept FastCGI requests. ; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; a specific port; -; 'port' - to listen on a TCP socket to all addresses on a +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all IPv4 addresses on a ; specific port; +; '[::]:port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. listen = 127.0.0.1:9000 @@ -171,7 +176,7 @@ listen = 127.0.0.1:9000 ;listen.group = @php_fpm_group@ ;listen.mode = 0660 -; List of ipv4 addresses of FastCGI clients which are allowed to connect. +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address ; must be separated by a comma. If this value is left blank, connections will be diff --git a/sapi/fpm/tests/003.phpt b/sapi/fpm/tests/003.phpt new file mode 100644 index 0000000000..389cb2401e --- /dev/null +++ b/sapi/fpm/tests/003.phpt @@ -0,0 +1,53 @@ +--TEST-- +FPM: Test IPv6 support +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + +$cfg = <<<EOT +[global] +error_log = $logfile +[unconfined] +listen = [::1]:9000 +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + var_dump(fgets($tail)); + var_dump(fgets($tail)); + $i = 0; + while (($i++ < 30) && !($fp = fsockopen('[::1]', 9000))) { + usleep(10000); + } + if ($fp) { + echo "Done\n"; + fclose($fp); + } + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +--EXPECTF-- +string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +" +string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +" +Done +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?> diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index 789ebf2460..bcc0390235 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -69,7 +69,7 @@ #define SAPI_LSAPI_MAX_HEADER_LENGTH 2048 -static int lsapi_mode = 1; +static int lsapi_mode = 0; static char *php_self = ""; static char *script_filename = ""; static int source_highlight = 0; @@ -155,7 +155,7 @@ static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ sapi_lsapi_flush */ -static void sapi_lsapi_flush( void * server_context ) +static void sapi_lsapi_flush( void * server_context TSRMLS_DC ) { if ( lsapi_mode ) { if ( LSAPI_Flush() == -1) { @@ -200,7 +200,12 @@ static char *sapi_lsapi_getenv( char * name, size_t name_len TSRMLS_DC ) static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { - int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER; +#if PHP_MAJOR_VERSION >= 7 + int filter_arg = (Z_ARR_P((zval *)arg) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV])) + ? PARSE_ENV : PARSE_SERVER; +#else + int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER; +#endif char * new_val = (char *) pValue; unsigned int new_val_len; @@ -238,27 +243,45 @@ static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC size_t alloc_size = sizeof(buf); unsigned long nlen; /* ptrdiff_t is not portable */ - if (PG(http_globals)[TRACK_VARS_ENV] && - array_ptr != PG(http_globals)[TRACK_VARS_ENV] && - Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && - zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0 +#if PHP_MAJOR_VERSION >= 7 + if (Z_TYPE(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && + Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_ENV]) && + zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_ENV])) > 0 ) { - zval_dtor(array_ptr); - *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; - INIT_PZVAL(array_ptr); - zval_copy_ctor(array_ptr); + zval_dtor(array_ptr); + ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_ENV]); return; - } else if (PG(http_globals)[TRACK_VARS_SERVER] && - array_ptr != PG(http_globals)[TRACK_VARS_SERVER] && - Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && - zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0 + } else if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && + Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_SERVER]) && + zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER])) > 0 ) { - zval_dtor(array_ptr); - *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; - INIT_PZVAL(array_ptr); - zval_copy_ctor(array_ptr); + zval_dtor(array_ptr); + ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_SERVER]); return; } +#else + if (PG(http_globals)[TRACK_VARS_ENV] && + array_ptr != PG(http_globals)[TRACK_VARS_ENV] && + Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && + zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0 + ) { + zval_dtor(array_ptr); + *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; + INIT_PZVAL(array_ptr); + zval_copy_ctor(array_ptr); + return; + } else if (PG(http_globals)[TRACK_VARS_SERVER] && + array_ptr != PG(http_globals)[TRACK_VARS_SERVER] && + Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && + zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0 + ) { + zval_dtor(array_ptr); + *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; + INIT_PZVAL(array_ptr); + zval_copy_ctor(array_ptr); + return; + } +#endif for (env = environ; env != NULL && *env != NULL; env++) { p = strchr(*env, '='); @@ -478,8 +501,8 @@ static int init_request_info( TSRMLS_D ) SG(request_info).content_length = LSAPI_GetReqBodyLen(); SG(request_info).path_translated = estrdup( LSAPI_GetScriptFileName()); - /* It is not reset by zend engine, set it to 0. */ - SG(sapi_headers).http_response_code = 0; + /* It is not reset by zend engine, set it to 200. */ + SG(sapi_headers).http_response_code = 200; pAuth = LSAPI_GetHeader( H_AUTHORIZATION ); php_handle_auth_data(pAuth TSRMLS_CC); @@ -592,6 +615,9 @@ static int lsapi_module_main(int show_source TSRMLS_DC) static int alter_ini( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { +#if PHP_MAJOR_VERSION >= 7 + zend_string * psKey; +#endif int type = ZEND_INI_PERDIR; if ( '\001' == *pKey ) { ++pKey; @@ -606,9 +632,19 @@ static int alter_ini( const char * pKey, int keyLen, const char * pValue, int va engine = 0; } else - zend_alter_ini_entry((char *)pKey, keyLen, + { +#if PHP_MAJOR_VERSION >= 7 + psKey = STR_INIT( pKey, keyLen, 1 ); + zend_alter_ini_entry(psKey, (char *)pValue, valLen, type, PHP_INI_STAGE_ACTIVATE); + STR_RELEASE( psKey ); +#else + zend_alter_ini_entry((char *)pKey, keyLen, + (char *)pValue, valLen, + type, PHP_INI_STAGE_ACTIVATE); +#endif + } } return 1; } @@ -749,6 +785,9 @@ static int cli_main( int argc, char * argv[] ) char ** argend= &argv[argc]; int ret = -1; int c; +#if PHP_MAJOR_VERSION >= 7 + zend_string * psKey; +#endif lsapi_mode = 0; /* enter CLI mode */ #ifdef PHP_WIN32 @@ -763,12 +802,21 @@ static int cli_main( int argc, char * argv[] ) zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */ CG(in_compilation) = 0; /* not initialized but needed for several options */ +#if PHP_MAJOR_VERSION < 7 EG(uninitialized_zval_ptr) = NULL; - +#endif for( ini = ini_defaults; *ini; ini+=2 ) { +#if PHP_MAJOR_VERSION >= 7 + psKey = STR_INIT( *ini, strlen( *ini ), 1 ); + zend_alter_ini_entry( psKey, + (char *)*(ini+1), strlen( *(ini+1) ), + PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); + STR_RELEASE( psKey ); +#else zend_alter_ini_entry( (char *)*ini, strlen( *ini )+1, (char *)*(ini+1), strlen( *(ini+1) ), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); +#endif } while (( p < argend )&&(**p == '-' )) { @@ -1053,6 +1101,7 @@ int main( int argc, char * argv[] ) LSAPI_Init(); LSAPI_Init_Env_Parameters( NULL ); + lsapi_mode = 1; slow_script_msec = LSAPI_Get_Slow_Req_Msecs(); @@ -1147,7 +1196,11 @@ zend_module_entry litespeed_module_entry = { static int add_associate_array( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { - add_assoc_string_ex( (zval *)arg, (char *)pKey, keyLen+1, (char *)pValue, 1 ); + add_assoc_string_ex( (zval *)arg, (char *)pKey, keyLen+1, (char *)pValue +#if PHP_MAJOR_VERSION < 7 + , 1 +#endif + ); return 1; } @@ -1201,7 +1254,11 @@ PHP_FUNCTION(litespeed_response_headers) headerBuf[len] = 0; if ( len ) { while( isspace(*++p)); - add_assoc_string_ex(return_value, headerBuf, len+1, p, 1 ); + add_assoc_string_ex(return_value, headerBuf, len+1, p +#if PHP_MAJOR_VERSION < 7 + , 1 +#endif + ); } } } @@ -1216,15 +1273,25 @@ PHP_FUNCTION(litespeed_response_headers) Fetch all loaded module names */ PHP_FUNCTION(apache_get_modules) { + static const char * mod_names[] = + { + "mod_rewrite", "mod_mime", "mod_headers", "mod_expires", NULL + }; + const char **name = mod_names; /* TODO: */ if (ZEND_NUM_ARGS() > 0) { WRONG_PARAM_COUNT; } array_init(return_value); - add_next_index_string(return_value, "mod_rewrite", 1); - add_next_index_string(return_value, "mod_mime", 1); - add_next_index_string(return_value, "mod_headers", 1); - add_next_index_string(return_value, "mod_expires", 1); + while( *name ) + { + add_next_index_string(return_value, *name +#if PHP_MAJOR_VERSION < 7 + , 1 +#endif + ); + ++name; + } } /* }}} */ |
