diff options
Diffstat (limited to 'ext')
65 files changed, 2845 insertions, 1330 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 9bb767624..01926a23c 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1194,6 +1194,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/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt index 103f1cf69..d82fe6f41 100644 --- a/ext/curl/tests/check_win_config.phpt +++ b/ext/curl/tests/check_win_config.phpt @@ -28,7 +28,7 @@ Features AsynchDNS => Yes
CharConv => No
Debug => No
-GSS-Negotiate => Yes
+GSS-Negotiate => No
IDN => Yes
IPv6 => Yes
krb4 => No
diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index a23104f68..0fd9bfbe1 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -1,4 +1,4 @@ -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 }, @@ -12,578 +12,579 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[582] = { { "Africa/Blantyre" , 0x00052F }, { "Africa/Brazzaville" , 0x000584 }, { "Africa/Bujumbura" , 0x0005D9 }, - { "Africa/Cairo" , 0x00061D }, - { "Africa/Casablanca" , 0x000A04 }, - { "Africa/Ceuta" , 0x000C66 }, - { "Africa/Conakry" , 0x000F6D }, - { "Africa/Dakar" , 0x000FC2 }, - { "Africa/Dar_es_Salaam" , 0x001017 }, - { "Africa/Djibouti" , 0x001084 }, - { "Africa/Douala" , 0x0010D9 }, - { "Africa/El_Aaiun" , 0x00112E }, - { "Africa/Freetown" , 0x001359 }, - { "Africa/Gaborone" , 0x0013AE }, - { "Africa/Harare" , 0x00141B }, - { "Africa/Johannesburg" , 0x001470 }, - { "Africa/Juba" , 0x0014DE }, - { "Africa/Kampala" , 0x0015F1 }, - { "Africa/Khartoum" , 0x001670 }, - { "Africa/Kigali" , 0x001783 }, - { "Africa/Kinshasa" , 0x0017D8 }, - { "Africa/Lagos" , 0x001844 }, - { "Africa/Libreville" , 0x001899 }, - { "Africa/Lome" , 0x0018EE }, - { "Africa/Luanda" , 0x001943 }, - { "Africa/Lubumbashi" , 0x001998 }, - { "Africa/Lusaka" , 0x0019F3 }, - { "Africa/Malabo" , 0x001A48 }, - { "Africa/Maputo" , 0x001A9D }, - { "Africa/Maseru" , 0x001AF2 }, - { "Africa/Mbabane" , 0x001B5A }, - { "Africa/Mogadishu" , 0x001BB0 }, - { "Africa/Monrovia" , 0x001C0B }, - { "Africa/Nairobi" , 0x001C71 }, - { "Africa/Ndjamena" , 0x001CF0 }, - { "Africa/Niamey" , 0x001D5C }, - { "Africa/Nouakchott" , 0x001DB1 }, - { "Africa/Ouagadougou" , 0x001E06 }, - { "Africa/Porto-Novo" , 0x001E5B }, - { "Africa/Sao_Tome" , 0x001EB0 }, - { "Africa/Timbuktu" , 0x001F05 }, - { "Africa/Tripoli" , 0x001F5A }, - { "Africa/Tunis" , 0x002063 }, - { "Africa/Windhoek" , 0x002175 }, - { "America/Adak" , 0x0023BC }, - { "America/Anchorage" , 0x002732 }, - { "America/Anguilla" , 0x002AA6 }, - { "America/Antigua" , 0x002AFB }, - { "America/Araguaina" , 0x002B61 }, - { "America/Argentina/Buenos_Aires" , 0x002CC6 }, - { "America/Argentina/Catamarca" , 0x002E74 }, - { "America/Argentina/ComodRivadavia" , 0x003035 }, - { "America/Argentina/Cordoba" , 0x0031DB }, - { "America/Argentina/Jujuy" , 0x0033B0 }, - { "America/Argentina/La_Rioja" , 0x003564 }, - { "America/Argentina/Mendoza" , 0x00371C }, - { "America/Argentina/Rio_Gallegos" , 0x0038DC }, - { "America/Argentina/Salta" , 0x003A91 }, - { "America/Argentina/San_Juan" , 0x003C3D }, - { "America/Argentina/San_Luis" , 0x003DF5 }, - { "America/Argentina/Tucuman" , 0x003FBB }, - { "America/Argentina/Ushuaia" , 0x004177 }, - { "America/Aruba" , 0x004332 }, - { "America/Asuncion" , 0x004398 }, - { "America/Atikokan" , 0x00467D }, - { "America/Atka" , 0x004753 }, - { "America/Bahia" , 0x004AB9 }, - { "America/Bahia_Banderas" , 0x004C4C }, - { "America/Barbados" , 0x004EC5 }, - { "America/Belem" , 0x004F5F }, - { "America/Belize" , 0x00505A }, - { "America/Blanc-Sablon" , 0x0051D6 }, - { "America/Boa_Vista" , 0x00528A }, - { "America/Bogota" , 0x005393 }, - { "America/Boise" , 0x0053FF }, - { "America/Buenos_Aires" , 0x005796 }, - { "America/Cambridge_Bay" , 0x00592F }, - { "America/Campo_Grande" , 0x005C57 }, - { "America/Cancun" , 0x005F46 }, - { "America/Caracas" , 0x006188 }, - { "America/Catamarca" , 0x0061EF }, - { "America/Cayenne" , 0x006395 }, - { "America/Cayman" , 0x0063F7 }, - { "America/Chicago" , 0x00644C }, - { "America/Chihuahua" , 0x006963 }, - { "America/Coral_Harbour" , 0x006BCE }, - { "America/Cordoba" , 0x006C60 }, - { "America/Costa_Rica" , 0x006E06 }, - { "America/Creston" , 0x006E90 }, - { "America/Cuiaba" , 0x006F1C }, - { "America/Curacao" , 0x0071FA }, - { "America/Danmarkshavn" , 0x007260 }, - { "America/Dawson" , 0x0073A4 }, - { "America/Dawson_Creek" , 0x0076C1 }, - { "America/Denver" , 0x00789B }, - { "America/Detroit" , 0x007C21 }, - { "America/Dominica" , 0x007F80 }, - { "America/Edmonton" , 0x007FD5 }, - { "America/Eirunepe" , 0x00838D }, - { "America/El_Salvador" , 0x0084A5 }, - { "America/Ensenada" , 0x00851A }, - { "America/Fort_Wayne" , 0x0089C1 }, - { "America/Fortaleza" , 0x008883 }, - { "America/Glace_Bay" , 0x008C2B }, - { "America/Godthab" , 0x008FA2 }, - { "America/Goose_Bay" , 0x009266 }, - { "America/Grand_Turk" , 0x009723 }, - { "America/Grenada" , 0x0098F8 }, - { "America/Guadeloupe" , 0x00994D }, - { "America/Guatemala" , 0x0099A2 }, - { "America/Guayaquil" , 0x009A2B }, - { "America/Guyana" , 0x009A88 }, - { "America/Halifax" , 0x009B09 }, - { "America/Havana" , 0x00A01F }, - { "America/Hermosillo" , 0x00A392 }, - { "America/Indiana/Indianapolis" , 0x00A470 }, - { "America/Indiana/Knox" , 0x00A701 }, - { "America/Indiana/Marengo" , 0x00AA98 }, - { "America/Indiana/Petersburg" , 0x00AD3E }, - { "America/Indiana/Tell_City" , 0x00B28B }, - { "America/Indiana/Vevay" , 0x00B524 }, - { "America/Indiana/Vincennes" , 0x00B75F }, - { "America/Indiana/Winamac" , 0x00BA13 }, - { "America/Indianapolis" , 0x00B021 }, - { "America/Inuvik" , 0x00BCCC }, - { "America/Iqaluit" , 0x00BFC3 }, - { "America/Jamaica" , 0x00C2E5 }, - { "America/Jujuy" , 0x00C3AA }, - { "America/Juneau" , 0x00C554 }, - { "America/Kentucky/Louisville" , 0x00C8D2 }, - { "America/Kentucky/Monticello" , 0x00CCF0 }, - { "America/Knox_IN" , 0x00D075 }, - { "America/Kralendijk" , 0x00D3E6 }, - { "America/La_Paz" , 0x00D44C }, - { "America/Lima" , 0x00D4B3 }, - { "America/Los_Angeles" , 0x00D55B }, - { "America/Louisville" , 0x00D96C }, - { "America/Lower_Princes" , 0x00DD61 }, - { "America/Maceio" , 0x00DDC7 }, - { "America/Managua" , 0x00DF01 }, - { "America/Manaus" , 0x00DFB4 }, - { "America/Marigot" , 0x00E0B6 }, - { "America/Martinique" , 0x00E10B }, - { "America/Matamoros" , 0x00E177 }, - { "America/Mazatlan" , 0x00E3D0 }, - { "America/Mendoza" , 0x00E63D }, - { "America/Menominee" , 0x00E7F1 }, - { "America/Merida" , 0x00EB72 }, - { "America/Metlakatla" , 0x00EDAD }, - { "America/Mexico_City" , 0x00EEE8 }, - { "America/Miquelon" , 0x00F163 }, - { "America/Moncton" , 0x00F3D5 }, - { "America/Monterrey" , 0x00F86C }, - { "America/Montevideo" , 0x00FACF }, - { "America/Montreal" , 0x00FDE1 }, - { "America/Montserrat" , 0x0102D1 }, - { "America/Nassau" , 0x010326 }, - { "America/New_York" , 0x01066B }, - { "America/Nipigon" , 0x010B76 }, - { "America/Nome" , 0x010EC7 }, - { "America/Noronha" , 0x011245 }, - { "America/North_Dakota/Beulah" , 0x011375 }, - { "America/North_Dakota/Center" , 0x011709 }, - { "America/North_Dakota/New_Salem" , 0x011A9D }, - { "America/Ojinaga" , 0x011E46 }, - { "America/Panama" , 0x0120A7 }, - { "America/Pangnirtung" , 0x0120FC }, - { "America/Paramaribo" , 0x012432 }, - { "America/Phoenix" , 0x0124C4 }, - { "America/Port-au-Prince" , 0x012582 }, - { "America/Port_of_Spain" , 0x0128A6 }, - { "America/Porto_Acre" , 0x0127A2 }, - { "America/Porto_Velho" , 0x0128FB }, - { "America/Puerto_Rico" , 0x0129F1 }, - { "America/Rainy_River" , 0x012A5C }, - { "America/Rankin_Inlet" , 0x012D94 }, - { "America/Recife" , 0x01307A }, - { "America/Regina" , 0x0131A4 }, - { "America/Resolute" , 0x013362 }, - { "America/Rio_Branco" , 0x01364A }, - { "America/Rosario" , 0x013752 }, - { "America/Santa_Isabel" , 0x0138F8 }, - { "America/Santarem" , 0x013C9B }, - { "America/Santiago" , 0x013DA0 }, - { "America/Santo_Domingo" , 0x014149 }, - { "America/Sao_Paulo" , 0x01420F }, - { "America/Scoresbysund" , 0x01451E }, - { "America/Shiprock" , 0x01480C }, - { "America/Sitka" , 0x014B85 }, - { "America/St_Barthelemy" , 0x014F0D }, - { "America/St_Johns" , 0x014F62 }, - { "America/St_Kitts" , 0x0154B5 }, - { "America/St_Lucia" , 0x01550A }, - { "America/St_Thomas" , 0x01555F }, - { "America/St_Vincent" , 0x0155B4 }, - { "America/Swift_Current" , 0x015609 }, - { "America/Tegucigalpa" , 0x01572A }, - { "America/Thule" , 0x0157A9 }, - { "America/Thunder_Bay" , 0x0159F0 }, - { "America/Tijuana" , 0x015D39 }, - { "America/Toronto" , 0x0160D2 }, - { "America/Tortola" , 0x0165F2 }, - { "America/Vancouver" , 0x016647 }, - { "America/Virgin" , 0x016A84 }, - { "America/Whitehorse" , 0x016AD9 }, - { "America/Winnipeg" , 0x016DF6 }, - { "America/Yakutat" , 0x017236 }, - { "America/Yellowknife" , 0x0175A1 }, - { "Antarctica/Casey" , 0x0178B1 }, - { "Antarctica/Davis" , 0x01794F }, - { "Antarctica/DumontDUrville" , 0x0179F0 }, - { "Antarctica/Macquarie" , 0x017A81 }, - { "Antarctica/Mawson" , 0x017CCE }, - { "Antarctica/McMurdo" , 0x017D4A }, - { "Antarctica/Palmer" , 0x0180F5 }, - { "Antarctica/Rothera" , 0x018411 }, - { "Antarctica/South_Pole" , 0x018487 }, - { "Antarctica/Syowa" , 0x018805 }, - { "Antarctica/Troll" , 0x018873 }, - { "Antarctica/Vostok" , 0x018A45 }, - { "Arctic/Longyearbyen" , 0x018AB6 }, - { "Asia/Aden" , 0x018DE8 }, - { "Asia/Almaty" , 0x018E3D }, - { "Asia/Amman" , 0x018FBC }, - { "Asia/Anadyr" , 0x019272 }, - { "Asia/Aqtau" , 0x019474 }, - { "Asia/Aqtobe" , 0x019673 }, - { "Asia/Ashgabat" , 0x01982B }, - { "Asia/Ashkhabad" , 0x019948 }, - { "Asia/Baghdad" , 0x019A65 }, - { "Asia/Bahrain" , 0x019BDA }, - { "Asia/Baku" , 0x019C40 }, - { "Asia/Bangkok" , 0x019F28 }, - { "Asia/Beirut" , 0x019F7D }, - { "Asia/Bishkek" , 0x01A28A }, - { "Asia/Brunei" , 0x01A436 }, - { "Asia/Calcutta" , 0x01A498 }, - { "Asia/Chita" , 0x01A511 }, - { "Asia/Choibalsan" , 0x01A726 }, - { "Asia/Chongqing" , 0x01A89F }, - { "Asia/Chungking" , 0x01A93F }, - { "Asia/Colombo" , 0x01A9DF }, - { "Asia/Dacca" , 0x01AA7B }, - { "Asia/Damascus" , 0x01AB21 }, - { "Asia/Dhaka" , 0x01AE71 }, - { "Asia/Dili" , 0x01AF17 }, - { "Asia/Dubai" , 0x01AFA1 }, - { "Asia/Dushanbe" , 0x01AFF6 }, - { "Asia/Gaza" , 0x01B0F9 }, - { "Asia/Harbin" , 0x01B44C }, - { "Asia/Hebron" , 0x01B4EC }, - { "Asia/Ho_Chi_Minh" , 0x01B848 }, - { "Asia/Hong_Kong" , 0x01B8C0 }, - { "Asia/Hovd" , 0x01BA82 }, - { "Asia/Irkutsk" , 0x01BBFA }, - { "Asia/Istanbul" , 0x01BDE5 }, - { "Asia/Jakarta" , 0x01C1D2 }, - { "Asia/Jayapura" , 0x01C27C }, - { "Asia/Jerusalem" , 0x01C319 }, - { "Asia/Kabul" , 0x01C648 }, - { "Asia/Kamchatka" , 0x01C699 }, - { "Asia/Karachi" , 0x01C892 }, - { "Asia/Kashgar" , 0x01C947 }, - { "Asia/Kathmandu" , 0x01C99C }, - { "Asia/Katmandu" , 0x01CA02 }, - { "Asia/Khandyga" , 0x01CA68 }, - { "Asia/Kolkata" , 0x01CC92 }, - { "Asia/Krasnoyarsk" , 0x01CD0B }, - { "Asia/Kuala_Lumpur" , 0x01CEF8 }, - { "Asia/Kuching" , 0x01CFB5 }, - { "Asia/Kuwait" , 0x01D0A3 }, - { "Asia/Macao" , 0x01D0F8 }, - { "Asia/Macau" , 0x01D233 }, - { "Asia/Magadan" , 0x01D36E }, - { "Asia/Makassar" , 0x01D572 }, - { "Asia/Manila" , 0x01D637 }, - { "Asia/Muscat" , 0x01D6BC }, - { "Asia/Nicosia" , 0x01D711 }, - { "Asia/Novokuznetsk" , 0x01D9F9 }, - { "Asia/Novosibirsk" , 0x01DC19 }, - { "Asia/Omsk" , 0x01DE09 }, - { "Asia/Oral" , 0x01DFF5 }, - { "Asia/Phnom_Penh" , 0x01E1C5 }, - { "Asia/Pontianak" , 0x01E23D }, - { "Asia/Pyongyang" , 0x01E2FF }, - { "Asia/Qatar" , 0x01E38F }, - { "Asia/Qyzylorda" , 0x01E3F5 }, - { "Asia/Rangoon" , 0x01E5CB }, - { "Asia/Riyadh" , 0x01E643 }, - { "Asia/Saigon" , 0x01E698 }, - { "Asia/Sakhalin" , 0x01E710 }, - { "Asia/Samarkand" , 0x01E90D }, - { "Asia/Seoul" , 0x01EA43 }, - { "Asia/Shanghai" , 0x01EB0A }, - { "Asia/Singapore" , 0x01EBB6 }, - { "Asia/Srednekolymsk" , 0x01EC6D }, - { "Asia/Taipei" , 0x01EE6D }, - { "Asia/Tashkent" , 0x01EF9E }, - { "Asia/Tbilisi" , 0x01F0CF }, - { "Asia/Tehran" , 0x01F289 }, - { "Asia/Tel_Aviv" , 0x01F4F7 }, - { "Asia/Thimbu" , 0x01F826 }, - { "Asia/Thimphu" , 0x01F88C }, - { "Asia/Tokyo" , 0x01F8F2 }, - { "Asia/Ujung_Pandang" , 0x01F97C }, - { "Asia/Ulaanbaatar" , 0x01F9F9 }, - { "Asia/Ulan_Bator" , 0x01FB54 }, - { "Asia/Urumqi" , 0x01FCA1 }, - { "Asia/Ust-Nera" , 0x01FD03 }, - { "Asia/Vientiane" , 0x01FF15 }, - { "Asia/Vladivostok" , 0x01FF8D }, - { "Asia/Yakutsk" , 0x020177 }, - { "Asia/Yekaterinburg" , 0x020361 }, - { "Asia/Yerevan" , 0x020582 }, - { "Atlantic/Azores" , 0x020782 }, - { "Atlantic/Bermuda" , 0x020C85 }, - { "Atlantic/Canary" , 0x020F66 }, - { "Atlantic/Cape_Verde" , 0x02123C }, - { "Atlantic/Faeroe" , 0x0212B5 }, - { "Atlantic/Faroe" , 0x021559 }, - { "Atlantic/Jan_Mayen" , 0x0217FD }, - { "Atlantic/Madeira" , 0x021B2F }, - { "Atlantic/Reykjavik" , 0x022038 }, - { "Atlantic/South_Georgia" , 0x0221F1 }, - { "Atlantic/St_Helena" , 0x022403 }, - { "Atlantic/Stanley" , 0x022235 }, - { "Australia/ACT" , 0x022458 }, - { "Australia/Adelaide" , 0x02277B }, - { "Australia/Brisbane" , 0x022AAD }, - { "Australia/Broken_Hill" , 0x022B7A }, - { "Australia/Canberra" , 0x022EBE }, - { "Australia/Currie" , 0x0231E1 }, - { "Australia/Darwin" , 0x02351A }, - { "Australia/Eucla" , 0x0235A6 }, - { "Australia/Hobart" , 0x023682 }, - { "Australia/LHI" , 0x0239E6 }, - { "Australia/Lindeman" , 0x023C87 }, - { "Australia/Lord_Howe" , 0x023D6E }, - { "Australia/Melbourne" , 0x02401F }, - { "Australia/North" , 0x02434A }, - { "Australia/NSW" , 0x0243C4 }, - { "Australia/Perth" , 0x0246E7 }, - { "Australia/Queensland" , 0x0247C5 }, - { "Australia/South" , 0x024877 }, - { "Australia/Sydney" , 0x024B9A }, - { "Australia/Tasmania" , 0x024EDD }, - { "Australia/Victoria" , 0x025228 }, - { "Australia/West" , 0x02554B }, - { "Australia/Yancowinna" , 0x025607 }, - { "Brazil/Acre" , 0x02592F }, - { "Brazil/DeNoronha" , 0x025A33 }, - { "Brazil/East" , 0x025B53 }, - { "Brazil/West" , 0x025E30 }, - { "Canada/Atlantic" , 0x025F28 }, - { "Canada/Central" , 0x026410 }, - { "Canada/East-Saskatchewan" , 0x026D1A }, - { "Canada/Eastern" , 0x02682A }, - { "Canada/Mountain" , 0x026EA3 }, - { "Canada/Newfoundland" , 0x027219 }, - { "Canada/Pacific" , 0x027744 }, - { "Canada/Saskatchewan" , 0x027B5D }, - { "Canada/Yukon" , 0x027CE6 }, - { "CET" , 0x027FE9 }, - { "Chile/Continental" , 0x0282F2 }, - { "Chile/EasterIsland" , 0x02868D }, - { "CST6CDT" , 0x0289CF }, - { "Cuba" , 0x028D20 }, - { "EET" , 0x029093 }, - { "Egypt" , 0x029346 }, - { "Eire" , 0x02972D }, - { "EST" , 0x029C3E }, - { "EST5EDT" , 0x029C82 }, - { "Etc/GMT" , 0x029FD3 }, - { "Etc/GMT+0" , 0x02A09F }, - { "Etc/GMT+1" , 0x02A129 }, - { "Etc/GMT+10" , 0x02A1B6 }, - { "Etc/GMT+11" , 0x02A244 }, - { "Etc/GMT+12" , 0x02A2D2 }, - { "Etc/GMT+2" , 0x02A3ED }, - { "Etc/GMT+3" , 0x02A479 }, - { "Etc/GMT+4" , 0x02A505 }, - { "Etc/GMT+5" , 0x02A591 }, - { "Etc/GMT+6" , 0x02A61D }, - { "Etc/GMT+7" , 0x02A6A9 }, - { "Etc/GMT+8" , 0x02A735 }, - { "Etc/GMT+9" , 0x02A7C1 }, - { "Etc/GMT-0" , 0x02A05B }, - { "Etc/GMT-1" , 0x02A0E3 }, - { "Etc/GMT-10" , 0x02A16F }, - { "Etc/GMT-11" , 0x02A1FD }, - { "Etc/GMT-12" , 0x02A28B }, - { "Etc/GMT-13" , 0x02A319 }, - { "Etc/GMT-14" , 0x02A360 }, - { "Etc/GMT-2" , 0x02A3A7 }, - { "Etc/GMT-3" , 0x02A433 }, - { "Etc/GMT-4" , 0x02A4BF }, - { "Etc/GMT-5" , 0x02A54B }, - { "Etc/GMT-6" , 0x02A5D7 }, - { "Etc/GMT-7" , 0x02A663 }, - { "Etc/GMT-8" , 0x02A6EF }, - { "Etc/GMT-9" , 0x02A77B }, - { "Etc/GMT0" , 0x02A017 }, - { "Etc/Greenwich" , 0x02A807 }, - { "Etc/UCT" , 0x02A84B }, - { "Etc/Universal" , 0x02A88F }, - { "Etc/UTC" , 0x02A8D3 }, - { "Etc/Zulu" , 0x02A917 }, - { "Europe/Amsterdam" , 0x02A95B }, - { "Europe/Andorra" , 0x02AD99 }, - { "Europe/Athens" , 0x02B015 }, - { "Europe/Belfast" , 0x02B358 }, - { "Europe/Belgrade" , 0x02B88F }, - { "Europe/Berlin" , 0x02BB58 }, - { "Europe/Bratislava" , 0x02BEBC }, - { "Europe/Brussels" , 0x02C1EE }, - { "Europe/Bucharest" , 0x02C625 }, - { "Europe/Budapest" , 0x02C94F }, - { "Europe/Busingen" , 0x02CCB8 }, - { "Europe/Chisinau" , 0x02CF6F }, - { "Europe/Copenhagen" , 0x02D2FD }, - { "Europe/Dublin" , 0x02D607 }, - { "Europe/Gibraltar" , 0x02DB18 }, - { "Europe/Guernsey" , 0x02DF6F }, - { "Europe/Helsinki" , 0x02E4A6 }, - { "Europe/Isle_of_Man" , 0x02E75C }, - { "Europe/Istanbul" , 0x02EC93 }, - { "Europe/Jersey" , 0x02F080 }, - { "Europe/Kaliningrad" , 0x02F5B7 }, - { "Europe/Kiev" , 0x02F822 }, - { "Europe/Lisbon" , 0x02FB3E }, - { "Europe/Ljubljana" , 0x030042 }, - { "Europe/London" , 0x03030B }, - { "Europe/Luxembourg" , 0x030842 }, - { "Europe/Madrid" , 0x030C98 }, - { "Europe/Malta" , 0x03105E }, - { "Europe/Mariehamn" , 0x031417 }, - { "Europe/Minsk" , 0x0316CD }, - { "Europe/Monaco" , 0x0318DB }, - { "Europe/Moscow" , 0x031D16 }, - { "Europe/Nicosia" , 0x031F70 }, - { "Europe/Oslo" , 0x032258 }, - { "Europe/Paris" , 0x03258A }, - { "Europe/Podgorica" , 0x0329D0 }, - { "Europe/Prague" , 0x032C99 }, - { "Europe/Riga" , 0x032FCB }, - { "Europe/Rome" , 0x033310 }, - { "Europe/Samara" , 0x0336D3 }, - { "Europe/San_Marino" , 0x03393C }, - { "Europe/Sarajevo" , 0x033CFF }, - { "Europe/Simferopol" , 0x033FC8 }, - { "Europe/Skopje" , 0x034219 }, - { "Europe/Sofia" , 0x0344E2 }, - { "Europe/Stockholm" , 0x0347EA }, - { "Europe/Tallinn" , 0x034A99 }, - { "Europe/Tirane" , 0x034DD3 }, - { "Europe/Tiraspol" , 0x0350D9 }, - { "Europe/Uzhgorod" , 0x035467 }, - { "Europe/Vaduz" , 0x03577E }, - { "Europe/Vatican" , 0x035A2D }, - { "Europe/Vienna" , 0x035DF0 }, - { "Europe/Vilnius" , 0x03611D }, - { "Europe/Volgograd" , 0x03645C }, - { "Europe/Warsaw" , 0x03667D }, - { "Europe/Zagreb" , 0x036A5E }, - { "Europe/Zaporozhye" , 0x036D27 }, - { "Europe/Zurich" , 0x037068 }, - { "Factory" , 0x037317 }, - { "GB" , 0x037388 }, - { "GB-Eire" , 0x0378BF }, - { "GMT" , 0x037DF6 }, - { "GMT+0" , 0x037EC2 }, - { "GMT-0" , 0x037E7E }, - { "GMT0" , 0x037E3A }, - { "Greenwich" , 0x037F06 }, - { "Hongkong" , 0x037F4A }, - { "HST" , 0x03810C }, - { "Iceland" , 0x038150 }, - { "Indian/Antananarivo" , 0x038309 }, - { "Indian/Chagos" , 0x03837D }, - { "Indian/Christmas" , 0x0383DF }, - { "Indian/Cocos" , 0x038423 }, - { "Indian/Comoro" , 0x038467 }, - { "Indian/Kerguelen" , 0x0384BC }, - { "Indian/Mahe" , 0x038511 }, - { "Indian/Maldives" , 0x038566 }, - { "Indian/Mauritius" , 0x0385BB }, - { "Indian/Mayotte" , 0x038631 }, - { "Indian/Reunion" , 0x038686 }, - { "Iran" , 0x0386DB }, - { "Israel" , 0x038949 }, - { "Jamaica" , 0x038C78 }, - { "Japan" , 0x038D3D }, - { "Kwajalein" , 0x038DC7 }, - { "Libya" , 0x038E2A }, - { "MET" , 0x038F33 }, - { "Mexico/BajaNorte" , 0x03923C }, - { "Mexico/BajaSur" , 0x0395A5 }, - { "Mexico/General" , 0x0397EA }, - { "MST" , 0x039A48 }, - { "MST7MDT" , 0x039A8C }, - { "Navajo" , 0x039DDD }, - { "NZ" , 0x03A156 }, - { "NZ-CHAT" , 0x03A4D4 }, - { "Pacific/Apia" , 0x03A7B8 }, - { "Pacific/Auckland" , 0x03A954 }, - { "Pacific/Chatham" , 0x03ACE0 }, - { "Pacific/Chuuk" , 0x03AFD3 }, - { "Pacific/Easter" , 0x03B02C }, - { "Pacific/Efate" , 0x03B37B }, - { "Pacific/Enderbury" , 0x03B441 }, - { "Pacific/Fakaofo" , 0x03B4AF }, - { "Pacific/Fiji" , 0x03B500 }, - { "Pacific/Funafuti" , 0x03B693 }, - { "Pacific/Galapagos" , 0x03B6D7 }, - { "Pacific/Gambier" , 0x03B74F }, - { "Pacific/Guadalcanal" , 0x03B7B4 }, - { "Pacific/Guam" , 0x03B809 }, - { "Pacific/Honolulu" , 0x03B85F }, - { "Pacific/Johnston" , 0x03B8D6 }, - { "Pacific/Kiritimati" , 0x03B955 }, - { "Pacific/Kosrae" , 0x03B9C0 }, - { "Pacific/Kwajalein" , 0x03BA1D }, - { "Pacific/Majuro" , 0x03BA89 }, - { "Pacific/Marquesas" , 0x03BAE8 }, - { "Pacific/Midway" , 0x03BB4F }, - { "Pacific/Nauru" , 0x03BBD9 }, - { "Pacific/Niue" , 0x03BC51 }, - { "Pacific/Norfolk" , 0x03BCAF }, - { "Pacific/Noumea" , 0x03BD04 }, - { "Pacific/Pago_Pago" , 0x03BD94 }, - { "Pacific/Palau" , 0x03BE0B }, - { "Pacific/Pitcairn" , 0x03BE4F }, - { "Pacific/Pohnpei" , 0x03BEA4 }, - { "Pacific/Ponape" , 0x03BEF9 }, - { "Pacific/Port_Moresby" , 0x03BF3E }, - { "Pacific/Rarotonga" , 0x03BF82 }, - { "Pacific/Saipan" , 0x03C05E }, - { "Pacific/Samoa" , 0x03C0C1 }, - { "Pacific/Tahiti" , 0x03C138 }, - { "Pacific/Tarawa" , 0x03C19D }, - { "Pacific/Tongatapu" , 0x03C1F1 }, - { "Pacific/Truk" , 0x03C27D }, - { "Pacific/Wake" , 0x03C2C2 }, - { "Pacific/Wallis" , 0x03C312 }, - { "Pacific/Yap" , 0x03C356 }, - { "Poland" , 0x03C39B }, - { "Portugal" , 0x03C77C }, - { "PRC" , 0x03CC78 }, - { "PST8PDT" , 0x03CD18 }, - { "ROC" , 0x03D069 }, - { "ROK" , 0x03D19A }, - { "Singapore" , 0x03D261 }, - { "Turkey" , 0x03D318 }, - { "UCT" , 0x03D705 }, - { "Universal" , 0x03D749 }, - { "US/Alaska" , 0x03D78D }, - { "US/Aleutian" , 0x03DAF6 }, - { "US/Arizona" , 0x03DE5C }, - { "US/Central" , 0x03DEEA }, - { "US/East-Indiana" , 0x03E8F4 }, - { "US/Eastern" , 0x03E3F5 }, - { "US/Hawaii" , 0x03EB5E }, - { "US/Indiana-Starke" , 0x03EBCF }, - { "US/Michigan" , 0x03EF40 }, - { "US/Mountain" , 0x03F277 }, - { "US/Pacific" , 0x03F5F0 }, - { "US/Pacific-New" , 0x03F9F5 }, - { "US/Samoa" , 0x03FDFA }, - { "UTC" , 0x03FE71 }, - { "W-SU" , 0x040168 }, - { "WET" , 0x03FEB5 }, - { "Zulu" , 0x0403AB }, + { "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" , 0x01B912 }, + { "Asia/Hovd" , 0x01BAD4 }, + { "Asia/Irkutsk" , 0x01BC4C }, + { "Asia/Istanbul" , 0x01BE37 }, + { "Asia/Jakarta" , 0x01C224 }, + { "Asia/Jayapura" , 0x01C2CE }, + { "Asia/Jerusalem" , 0x01C36B }, + { "Asia/Kabul" , 0x01C69A }, + { "Asia/Kamchatka" , 0x01C6EB }, + { "Asia/Karachi" , 0x01C8E4 }, + { "Asia/Kashgar" , 0x01C999 }, + { "Asia/Kathmandu" , 0x01C9EE }, + { "Asia/Katmandu" , 0x01CA54 }, + { "Asia/Khandyga" , 0x01CABA }, + { "Asia/Kolkata" , 0x01CCE4 }, + { "Asia/Krasnoyarsk" , 0x01CD5D }, + { "Asia/Kuala_Lumpur" , 0x01CF4A }, + { "Asia/Kuching" , 0x01D007 }, + { "Asia/Kuwait" , 0x01D0F5 }, + { "Asia/Macao" , 0x01D14A }, + { "Asia/Macau" , 0x01D285 }, + { "Asia/Magadan" , 0x01D3C0 }, + { "Asia/Makassar" , 0x01D5C4 }, + { "Asia/Manila" , 0x01D689 }, + { "Asia/Muscat" , 0x01D70E }, + { "Asia/Nicosia" , 0x01D763 }, + { "Asia/Novokuznetsk" , 0x01DA4B }, + { "Asia/Novosibirsk" , 0x01DC6B }, + { "Asia/Omsk" , 0x01DE5B }, + { "Asia/Oral" , 0x01E047 }, + { "Asia/Phnom_Penh" , 0x01E217 }, + { "Asia/Pontianak" , 0x01E26C }, + { "Asia/Pyongyang" , 0x01E32E }, + { "Asia/Qatar" , 0x01E3BE }, + { "Asia/Qyzylorda" , 0x01E424 }, + { "Asia/Rangoon" , 0x01E5FA }, + { "Asia/Riyadh" , 0x01E672 }, + { "Asia/Saigon" , 0x01E6C7 }, + { "Asia/Sakhalin" , 0x01E769 }, + { "Asia/Samarkand" , 0x01E966 }, + { "Asia/Seoul" , 0x01EA9C }, + { "Asia/Shanghai" , 0x01EB63 }, + { "Asia/Singapore" , 0x01EC0F }, + { "Asia/Srednekolymsk" , 0x01ECC6 }, + { "Asia/Taipei" , 0x01EEC6 }, + { "Asia/Tashkent" , 0x01EFF7 }, + { "Asia/Tbilisi" , 0x01F128 }, + { "Asia/Tehran" , 0x01F2E2 }, + { "Asia/Tel_Aviv" , 0x01F550 }, + { "Asia/Thimbu" , 0x01F87F }, + { "Asia/Thimphu" , 0x01F8E5 }, + { "Asia/Tokyo" , 0x01F94B }, + { "Asia/Ujung_Pandang" , 0x01F9D5 }, + { "Asia/Ulaanbaatar" , 0x01FA52 }, + { "Asia/Ulan_Bator" , 0x01FBAD }, + { "Asia/Urumqi" , 0x01FCFA }, + { "Asia/Ust-Nera" , 0x01FD5C }, + { "Asia/Vientiane" , 0x01FF6E }, + { "Asia/Vladivostok" , 0x01FFC3 }, + { "Asia/Yakutsk" , 0x0201AD }, + { "Asia/Yekaterinburg" , 0x020397 }, + { "Asia/Yerevan" , 0x0205B8 }, + { "Atlantic/Azores" , 0x0207B8 }, + { "Atlantic/Bermuda" , 0x020CBB }, + { "Atlantic/Canary" , 0x020F9C }, + { "Atlantic/Cape_Verde" , 0x021272 }, + { "Atlantic/Faeroe" , 0x0212EB }, + { "Atlantic/Faroe" , 0x02158F }, + { "Atlantic/Jan_Mayen" , 0x021833 }, + { "Atlantic/Madeira" , 0x021B65 }, + { "Atlantic/Reykjavik" , 0x02206E }, + { "Atlantic/South_Georgia" , 0x022227 }, + { "Atlantic/St_Helena" , 0x022439 }, + { "Atlantic/Stanley" , 0x02226B }, + { "Australia/ACT" , 0x02248E }, + { "Australia/Adelaide" , 0x0227B1 }, + { "Australia/Brisbane" , 0x022AE3 }, + { "Australia/Broken_Hill" , 0x022BB0 }, + { "Australia/Canberra" , 0x022EF4 }, + { "Australia/Currie" , 0x023217 }, + { "Australia/Darwin" , 0x023550 }, + { "Australia/Eucla" , 0x0235DC }, + { "Australia/Hobart" , 0x0236B8 }, + { "Australia/LHI" , 0x023A1C }, + { "Australia/Lindeman" , 0x023CBD }, + { "Australia/Lord_Howe" , 0x023DA4 }, + { "Australia/Melbourne" , 0x024055 }, + { "Australia/North" , 0x024380 }, + { "Australia/NSW" , 0x0243FA }, + { "Australia/Perth" , 0x02471D }, + { "Australia/Queensland" , 0x0247FB }, + { "Australia/South" , 0x0248AD }, + { "Australia/Sydney" , 0x024BD0 }, + { "Australia/Tasmania" , 0x024F13 }, + { "Australia/Victoria" , 0x02525E }, + { "Australia/West" , 0x025581 }, + { "Australia/Yancowinna" , 0x02563D }, + { "Brazil/Acre" , 0x025965 }, + { "Brazil/DeNoronha" , 0x025A69 }, + { "Brazil/East" , 0x025B89 }, + { "Brazil/West" , 0x025E66 }, + { "Canada/Atlantic" , 0x025F5E }, + { "Canada/Central" , 0x026446 }, + { "Canada/East-Saskatchewan" , 0x026D50 }, + { "Canada/Eastern" , 0x026860 }, + { "Canada/Mountain" , 0x026ED9 }, + { "Canada/Newfoundland" , 0x02724F }, + { "Canada/Pacific" , 0x02777A }, + { "Canada/Saskatchewan" , 0x027B93 }, + { "Canada/Yukon" , 0x027D1C }, + { "CET" , 0x02801F }, + { "Chile/Continental" , 0x028328 }, + { "Chile/EasterIsland" , 0x0286C3 }, + { "CST6CDT" , 0x028A05 }, + { "Cuba" , 0x028D56 }, + { "EET" , 0x0290C9 }, + { "Egypt" , 0x02937C }, + { "Eire" , 0x029763 }, + { "EST" , 0x029C74 }, + { "EST5EDT" , 0x029CB8 }, + { "Etc/GMT" , 0x02A009 }, + { "Etc/GMT+0" , 0x02A0D5 }, + { "Etc/GMT+1" , 0x02A15F }, + { "Etc/GMT+10" , 0x02A1EC }, + { "Etc/GMT+11" , 0x02A27A }, + { "Etc/GMT+12" , 0x02A308 }, + { "Etc/GMT+2" , 0x02A423 }, + { "Etc/GMT+3" , 0x02A4AF }, + { "Etc/GMT+4" , 0x02A53B }, + { "Etc/GMT+5" , 0x02A5C7 }, + { "Etc/GMT+6" , 0x02A653 }, + { "Etc/GMT+7" , 0x02A6DF }, + { "Etc/GMT+8" , 0x02A76B }, + { "Etc/GMT+9" , 0x02A7F7 }, + { "Etc/GMT-0" , 0x02A091 }, + { "Etc/GMT-1" , 0x02A119 }, + { "Etc/GMT-10" , 0x02A1A5 }, + { "Etc/GMT-11" , 0x02A233 }, + { "Etc/GMT-12" , 0x02A2C1 }, + { "Etc/GMT-13" , 0x02A34F }, + { "Etc/GMT-14" , 0x02A396 }, + { "Etc/GMT-2" , 0x02A3DD }, + { "Etc/GMT-3" , 0x02A469 }, + { "Etc/GMT-4" , 0x02A4F5 }, + { "Etc/GMT-5" , 0x02A581 }, + { "Etc/GMT-6" , 0x02A60D }, + { "Etc/GMT-7" , 0x02A699 }, + { "Etc/GMT-8" , 0x02A725 }, + { "Etc/GMT-9" , 0x02A7B1 }, + { "Etc/GMT0" , 0x02A04D }, + { "Etc/Greenwich" , 0x02A83D }, + { "Etc/UCT" , 0x02A881 }, + { "Etc/Universal" , 0x02A8C5 }, + { "Etc/UTC" , 0x02A909 }, + { "Etc/Zulu" , 0x02A94D }, + { "Europe/Amsterdam" , 0x02A991 }, + { "Europe/Andorra" , 0x02ADCF }, + { "Europe/Athens" , 0x02B04B }, + { "Europe/Belfast" , 0x02B38E }, + { "Europe/Belgrade" , 0x02B8C5 }, + { "Europe/Berlin" , 0x02BB8E }, + { "Europe/Bratislava" , 0x02BEF2 }, + { "Europe/Brussels" , 0x02C224 }, + { "Europe/Bucharest" , 0x02C65B }, + { "Europe/Budapest" , 0x02C985 }, + { "Europe/Busingen" , 0x02CCEE }, + { "Europe/Chisinau" , 0x02CFA5 }, + { "Europe/Copenhagen" , 0x02D333 }, + { "Europe/Dublin" , 0x02D63D }, + { "Europe/Gibraltar" , 0x02DB4E }, + { "Europe/Guernsey" , 0x02DFA5 }, + { "Europe/Helsinki" , 0x02E4DC }, + { "Europe/Isle_of_Man" , 0x02E792 }, + { "Europe/Istanbul" , 0x02ECC9 }, + { "Europe/Jersey" , 0x02F0B6 }, + { "Europe/Kaliningrad" , 0x02F5ED }, + { "Europe/Kiev" , 0x02F858 }, + { "Europe/Lisbon" , 0x02FB74 }, + { "Europe/Ljubljana" , 0x030078 }, + { "Europe/London" , 0x030341 }, + { "Europe/Luxembourg" , 0x030878 }, + { "Europe/Madrid" , 0x030CCE }, + { "Europe/Malta" , 0x031094 }, + { "Europe/Mariehamn" , 0x03144D }, + { "Europe/Minsk" , 0x031703 }, + { "Europe/Monaco" , 0x031916 }, + { "Europe/Moscow" , 0x031D51 }, + { "Europe/Nicosia" , 0x031FAB }, + { "Europe/Oslo" , 0x032293 }, + { "Europe/Paris" , 0x0325C5 }, + { "Europe/Podgorica" , 0x032A0B }, + { "Europe/Prague" , 0x032CD4 }, + { "Europe/Riga" , 0x033006 }, + { "Europe/Rome" , 0x03334B }, + { "Europe/Samara" , 0x03370E }, + { "Europe/San_Marino" , 0x033977 }, + { "Europe/Sarajevo" , 0x033D3A }, + { "Europe/Simferopol" , 0x034003 }, + { "Europe/Skopje" , 0x034254 }, + { "Europe/Sofia" , 0x03451D }, + { "Europe/Stockholm" , 0x034825 }, + { "Europe/Tallinn" , 0x034AD4 }, + { "Europe/Tirane" , 0x034E0E }, + { "Europe/Tiraspol" , 0x035114 }, + { "Europe/Uzhgorod" , 0x0354A2 }, + { "Europe/Vaduz" , 0x0357B9 }, + { "Europe/Vatican" , 0x035A68 }, + { "Europe/Vienna" , 0x035E2B }, + { "Europe/Vilnius" , 0x036158 }, + { "Europe/Volgograd" , 0x036497 }, + { "Europe/Warsaw" , 0x0366B8 }, + { "Europe/Zagreb" , 0x036A99 }, + { "Europe/Zaporozhye" , 0x036D62 }, + { "Europe/Zurich" , 0x0370A3 }, + { "Factory" , 0x037352 }, + { "GB" , 0x0373C3 }, + { "GB-Eire" , 0x0378FA }, + { "GMT" , 0x037E31 }, + { "GMT+0" , 0x037EFD }, + { "GMT-0" , 0x037EB9 }, + { "GMT0" , 0x037E75 }, + { "Greenwich" , 0x037F41 }, + { "Hongkong" , 0x037F85 }, + { "HST" , 0x038147 }, + { "Iceland" , 0x03818B }, + { "Indian/Antananarivo" , 0x038344 }, + { "Indian/Chagos" , 0x0383B8 }, + { "Indian/Christmas" , 0x03841A }, + { "Indian/Cocos" , 0x03845E }, + { "Indian/Comoro" , 0x0384A2 }, + { "Indian/Kerguelen" , 0x0384F7 }, + { "Indian/Mahe" , 0x03854C }, + { "Indian/Maldives" , 0x0385A1 }, + { "Indian/Mauritius" , 0x0385F6 }, + { "Indian/Mayotte" , 0x03866C }, + { "Indian/Reunion" , 0x0386C1 }, + { "Iran" , 0x038716 }, + { "Israel" , 0x038984 }, + { "Jamaica" , 0x038CB3 }, + { "Japan" , 0x038D78 }, + { "Kwajalein" , 0x038E02 }, + { "Libya" , 0x038E65 }, + { "MET" , 0x038F6E }, + { "Mexico/BajaNorte" , 0x039277 }, + { "Mexico/BajaSur" , 0x0395E0 }, + { "Mexico/General" , 0x039825 }, + { "MST" , 0x039A83 }, + { "MST7MDT" , 0x039AC7 }, + { "Navajo" , 0x039E18 }, + { "NZ" , 0x03A191 }, + { "NZ-CHAT" , 0x03A50F }, + { "Pacific/Apia" , 0x03A7F3 }, + { "Pacific/Auckland" , 0x03A98F }, + { "Pacific/Bougainville" , 0x03AD1B }, + { "Pacific/Chatham" , 0x03AD92 }, + { "Pacific/Chuuk" , 0x03B085 }, + { "Pacific/Easter" , 0x03B0DE }, + { "Pacific/Efate" , 0x03B42D }, + { "Pacific/Enderbury" , 0x03B4F3 }, + { "Pacific/Fakaofo" , 0x03B561 }, + { "Pacific/Fiji" , 0x03B5B2 }, + { "Pacific/Funafuti" , 0x03B745 }, + { "Pacific/Galapagos" , 0x03B789 }, + { "Pacific/Gambier" , 0x03B801 }, + { "Pacific/Guadalcanal" , 0x03B866 }, + { "Pacific/Guam" , 0x03B8BB }, + { "Pacific/Honolulu" , 0x03B911 }, + { "Pacific/Johnston" , 0x03B988 }, + { "Pacific/Kiritimati" , 0x03BA07 }, + { "Pacific/Kosrae" , 0x03BA72 }, + { "Pacific/Kwajalein" , 0x03BACF }, + { "Pacific/Majuro" , 0x03BB3B }, + { "Pacific/Marquesas" , 0x03BB9A }, + { "Pacific/Midway" , 0x03BC01 }, + { "Pacific/Nauru" , 0x03BC8B }, + { "Pacific/Niue" , 0x03BD03 }, + { "Pacific/Norfolk" , 0x03BD61 }, + { "Pacific/Noumea" , 0x03BDB6 }, + { "Pacific/Pago_Pago" , 0x03BE46 }, + { "Pacific/Palau" , 0x03BEBD }, + { "Pacific/Pitcairn" , 0x03BF01 }, + { "Pacific/Pohnpei" , 0x03BF56 }, + { "Pacific/Ponape" , 0x03BFAB }, + { "Pacific/Port_Moresby" , 0x03BFF0 }, + { "Pacific/Rarotonga" , 0x03C042 }, + { "Pacific/Saipan" , 0x03C11E }, + { "Pacific/Samoa" , 0x03C181 }, + { "Pacific/Tahiti" , 0x03C1F8 }, + { "Pacific/Tarawa" , 0x03C25D }, + { "Pacific/Tongatapu" , 0x03C2B1 }, + { "Pacific/Truk" , 0x03C33D }, + { "Pacific/Wake" , 0x03C382 }, + { "Pacific/Wallis" , 0x03C3D2 }, + { "Pacific/Yap" , 0x03C416 }, + { "Poland" , 0x03C45B }, + { "Portugal" , 0x03C83C }, + { "PRC" , 0x03CD38 }, + { "PST8PDT" , 0x03CDD8 }, + { "ROC" , 0x03D129 }, + { "ROK" , 0x03D25A }, + { "Singapore" , 0x03D321 }, + { "Turkey" , 0x03D3D8 }, + { "UCT" , 0x03D7C5 }, + { "Universal" , 0x03D809 }, + { "US/Alaska" , 0x03D84D }, + { "US/Aleutian" , 0x03DBB6 }, + { "US/Arizona" , 0x03DF1C }, + { "US/Central" , 0x03DFAA }, + { "US/East-Indiana" , 0x03E9B4 }, + { "US/Eastern" , 0x03E4B5 }, + { "US/Hawaii" , 0x03EC1E }, + { "US/Indiana-Starke" , 0x03EC8F }, + { "US/Michigan" , 0x03F000 }, + { "US/Mountain" , 0x03F337 }, + { "US/Pacific" , 0x03F6B0 }, + { "US/Pacific-New" , 0x03FAB5 }, + { "US/Samoa" , 0x03FEBA }, + { "UTC" , 0x03FF31 }, + { "W-SU" , 0x040228 }, + { "WET" , 0x03FF75 }, + { "Zulu" , 0x04046B }, }; /* This is a generated file, do not modify */ -const unsigned char timelib_timezone_db_data_builtin[263151] = { +const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Africa/Abidjan */ @@ -698,8 +699,8 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Blantyre */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x57, 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, 0x82, 0x46, 0xC3, 0xB0, -0x01, 0x00, 0x00, 0x20, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x3E, 0xE2, 0x01, 0x48, 0x10, 0x60, 0x00, 0x00, 0x00, 0x00, @@ -713,10 +714,11 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Bujumbura */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -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, 0x1C, 0x20, -0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x84, 0x2A, 0xA2, 0x01, 0x3F, 0x77, 0xDA, -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, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x2A, 0xA2, 0x01, 0x3F, 0x77, +0xDA, 0x00, 0x00, 0x00, 0x00, /* Africa/Cairo */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -963,18 +965,17 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Gaborone */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x57, 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, 0x82, 0x46, 0xCF, 0x68, -0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x15, 0x18, 0x00, -0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x53, 0x41, 0x53, -0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x63, 0xB7, 0x57, 0x01, 0x3A, 0x34, 0x32, 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, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xB7, 0x57, 0x01, 0x3A, 0x34, +0x32, 0x00, 0x00, 0x00, 0x00, /* Africa/Harare */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 0x57, 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, 0x82, 0x46, 0xC7, 0x64, -0x01, 0x00, 0x00, 0x1D, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x1E, 0x1A, 0x01, 0x42, 0x09, 0x68, 0x00, 0x00, 0x00, 0x00, @@ -1040,8 +1041,8 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Kigali */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x57, 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, 0xBE, 0xF1, 0x0E, 0x50, -0x01, 0x00, 0x00, 0x1C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x5A, 0x88, 0x01, 0x40, 0x89, 0x4A, 0x00, 0x00, 0x00, 0x00, @@ -1088,17 +1089,18 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Lubumbashi */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -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, 0x1C, 0x20, -0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x77, 0x86, 0xF5, 0x01, 0x3C, 0x91, 0xAA, -0x00, 0x00, 0x00, 0x17, 0x65, 0x61, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52, 0x65, -0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F, +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, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x86, 0xF5, 0x01, 0x3C, 0x91, +0xAA, 0x00, 0x00, 0x00, 0x17, 0x65, 0x61, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52, +0x65, 0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F, /* Africa/Lusaka */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 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, 0x82, 0x46, 0xC9, 0xFC, -0x01, 0x00, 0x00, 0x1A, 0x84, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0xCE, 0x1D, 0x01, 0x3D, 0xD0, 0xAD, 0x00, 0x00, 0x00, 0x00, @@ -1121,19 +1123,20 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Maseru */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x53, 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, 0x09, 0x82, 0x46, 0xCA, 0xB8, -0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x19, 0xC8, 0x00, -0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x5D, 0xD5, -0x01, 0x3C, 0x9E, 0xB0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68, +0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, +0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x5C, 0x5D, 0xD5, 0x01, 0x3C, 0x9E, 0xB0, 0x00, 0x00, 0x00, 0x00, /* Africa/Mbabane */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x5A, 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, 0x82, 0x46, 0xC7, 0x58, -0x01, 0x00, 0x00, 0x1D, 0x28, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x32, 0xD0, 0x01, 0x42, -0x1C, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68, +0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, +0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x61, 0x32, 0xD0, 0x01, 0x42, 0x1C, 0xF0, 0x00, 0x00, 0x00, 0x00, /* Africa/Mogadishu */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -4056,7 +4059,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4D, 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, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, +0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, @@ -8302,13 +8305,16 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* 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, @@ -8909,7 +8915,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Asia/Novokuznetsk */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0xF9, 0x13, 0x40, +0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x18, 0x20, 0xC0, 0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10, 0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90, 0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0, @@ -8934,7 +8940,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60, 0x00, 0x15, 0x00, 0x00, 0x62, -0x70, 0x00, 0x15, 0x4E, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x53, +0x70, 0x00, 0x15, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x53, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0x58, 0x58, 0x01, 0x97, 0x96, 0x72, 0x00, 0x00, 0x00, 0x31, 0x4D, @@ -9044,13 +9050,11 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* 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, @@ -9140,13 +9144,16 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* 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, @@ -9582,13 +9589,11 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* 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, @@ -14389,7 +14394,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* 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, @@ -14406,20 +14411,21 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 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, @@ -16412,7 +16418,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 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, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, +0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, @@ -16964,6 +16970,16 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 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, @@ -17116,19 +17132,19 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 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, @@ -17336,7 +17352,8 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 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, @@ -18530,4 +18547,4 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 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.7", 582, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2014.9", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 64a40a21e..bf29a5606 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -330,7 +330,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) @@ -3848,7 +3848,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) @@ -3858,13 +3858,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 000000000..ce2105aba --- /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 a86d5e10b..ecd99d5bc 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 b8ca2c1c1..c9fa25ce9 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 93311f3a6..c83b69749 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/dom/dom_properties.h b/ext/dom/dom_properties.h index a658b1d84..9d82d0e86 100644 --- a/ext/dom/dom_properties.h +++ b/ext/dom/dom_properties.h @@ -137,6 +137,8 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC); /* nodelist properties */ int dom_nodelist_length_read(dom_object *obj, zval **retval TSRMLS_DC); +xmlNodePtr dom_nodelist_xml_item(dom_nnodemap_object *objmap, long index); +xmlNodePtr dom_nodelist_baseobj_item(dom_nnodemap_object *objmap, long index); /* notation properties */ int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC); diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index a9621eeb4..4e035c764 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -72,6 +72,7 @@ zend_class_entry *dom_namespace_node_class_entry; /* }}} */ zend_object_handlers dom_object_handlers; +zend_object_handlers dom_nnodemap_object_handlers; static HashTable classes; /* {{{ prop handler tables */ @@ -668,6 +669,10 @@ PHP_MINIT_FUNCTION(dom) dom_object_handlers.has_property = dom_property_exists; dom_object_handlers.get_debug_info = dom_get_debug_info; + memcpy(&dom_nnodemap_object_handlers, &dom_object_handlers, sizeof(zend_object_handlers)); + dom_nnodemap_object_handlers.read_dimension = dom_nodelist_read_dimension; + dom_nnodemap_object_handlers.has_dimension = dom_nodelist_has_dimension; + zend_hash_init(&classes, 0, NULL, NULL, 1); INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions); @@ -1297,7 +1302,7 @@ zend_object_value dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_D retval.handle = zend_objects_store_put(intern, dom_nnodemap_object_dtor, (zend_objects_free_object_storage_t)dom_nnodemap_objects_free_storage, dom_objects_clone TSRMLS_CC); intern->handle = retval.handle; - retval.handlers = dom_get_obj_handlers(TSRMLS_C); + retval.handlers = &dom_nnodemap_object_handlers; return retval; } @@ -1674,6 +1679,54 @@ xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName) { } /* }}} end dom_get_nsdecl */ +static inline long dom_get_long(zval *offset) /* {{{ */ +{ + if (Z_TYPE_P(offset) == IS_LONG) { + return Z_LVAL_P(offset); + } else { + zval tmp; + + MAKE_COPY_ZVAL(&offset, &tmp); + convert_to_long(&tmp); + + return Z_LVAL(tmp); + } +} +/* }}} */ + +zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */ +{ + zval *rv, offset_copy = zval_used_for_init; + + if (!offset) { + return NULL; + } + + ZVAL_LONG(&offset_copy, dom_get_long(offset)); + + zend_call_method_with_1_params(&object, Z_OBJCE_P(object), NULL, "item", &rv, &offset_copy); + + Z_DELREF_P(rv); + + return rv; +} /* }}} end dom_nodelist_read_dimension */ + +int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC) +{ + long offset = dom_get_long(member); + + if (offset < 0) { + return 0; + } else { + zval *length = zend_read_property(Z_OBJCE_P(object), object, "length", sizeof("length") - 1, 0 TSRMLS_CC); + int ret = length && offset < Z_LVAL_P(length); + + FREE_ZVAL(length); + + return ret; + } +} /* }}} end dom_nodelist_has_dimension */ + #endif /* HAVE_DOM */ /* diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index f5f0bc6a7..6f0d9b80c 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -123,6 +123,8 @@ xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index); xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index); zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC); +zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type TSRMLS_DC); +int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC); #define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \ INIT_CLASS_ENTRY(ce, name, funcs); \ diff --git a/ext/dom/tests/bug67949.phpt b/ext/dom/tests/bug67949.phpt new file mode 100644 index 000000000..e4eb6f724 --- /dev/null +++ b/ext/dom/tests/bug67949.phpt @@ -0,0 +1,87 @@ +--TEST-- +Bug #67949: DOMNodeList elements should be accessible through array notation +--FILE-- +<?php + +$html = <<<HTML +<div>data</div> +<a href="test">hello world</a> +HTML; +$doc = new DOMDocument; +$doc->loadHTML($html); + +$nodes = $doc->getElementsByTagName('div'); + +echo "testing has_dimension\n"; +var_dump(isset($nodes[0])); +var_dump(isset($nodes[1])); +var_dump(isset($nodes[-1])); + +echo "testing property access\n"; +var_dump($nodes[0]->textContent); +var_dump($nodes[1]->textContent); + +echo "testing offset not a long\n"; +$offset = ['test']; +var_dump($offset); +var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent); +var_dump($offset); + +$something = 'test'; +$offset = &$something; + +var_dump($offset); +var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent); +var_dump($offset); + +$offset = 'test'; +var_dump($offset); +var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent); +var_dump($offset); + +echo "testing read_dimension with null offset\n"; +var_dump($nodes[][] = 1); + +echo "testing attribute access\n"; +$anchor = $doc->getElementsByTagName('a')[0]; +var_dump($anchor->attributes[0]->name); + +echo "==DONE==\n"; + +--EXPECTF-- +testing has_dimension +bool(true) +bool(false) +bool(false) +testing property access +string(4) "data" + +Notice: Trying to get property of non-object in %s on line %d +NULL +testing offset not a long +array(1) { + [0]=> + string(4) "test" +} + +Notice: Trying to get property of non-object in %s on line %d +bool(false) +NULL +array(1) { + [0]=> + string(4) "test" +} +string(4) "test" +bool(true) +string(4) "data" +string(4) "test" +string(4) "test" +bool(true) +string(4) "data" +string(4) "test" +testing read_dimension with null offset +NULL +testing attribute access +string(4) "href" +==DONE== + diff --git a/ext/ext_skel b/ext/ext_skel index e6b01fd4f..c0c398d15 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 8b0b9a891..2d987e457 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 Tue Nov 19 22:01:12 2013 -+++ libmagic/apprentice.c Mon Mar 31 17:15:53 2014 ++++ libmagic/apprentice.c Fri Oct 3 22:48:34 2014 @@ -29,6 +29,8 @@ * apprentice - make one pass through /etc/magic, learning its secrets. */ @@ -454,6 +454,15 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c return NULL; } return map; +@@ -1248,7 +1272,7 @@ + * the sign extension must have happened. + */ + case FILE_BYTE: +- v = (char) v; ++ v = (signed char) v; + break; + case FILE_SHORT: + case FILE_BESHORT: @@ -1516,7 +1540,7 @@ if (me->cont_count == me->max_count) { struct magic *nm; @@ -822,7 +831,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c } diff -u libmagic.orig/cdf.c libmagic/cdf.c --- libmagic.orig/cdf.c Tue Feb 26 17:20:42 2013 -+++ libmagic/cdf.c Tue Jul 1 08:57:25 2014 ++++ libmagic/cdf.c Fri Oct 3 22:48:34 2014 @@ -35,7 +35,7 @@ #include "file.h" @@ -937,7 +946,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c /* If the it is not there, just fake it; some docs don't have it */ if (d->d_stream_first_sector < 0) -@@ -796,7 +815,11 @@ +@@ -796,11 +815,15 @@ if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1) goto out; for (i = 0; i < sh.sh_properties; i++) { @@ -950,6 +959,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 +833,10 @@ i, inp[i].pi_id, inp[i].pi_type, q - p, offs)); if (inp[i].pi_type & CDF_VECTOR) { @@ -1814,7 +1828,16 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c } diff -u libmagic.orig/funcs.c libmagic/funcs.c --- libmagic.orig/funcs.c Thu Feb 13 00:20:53 2014 -+++ libmagic/funcs.c Wed Mar 19 13:28:34 2014 ++++ libmagic/funcs.c Fri Oct 3 22:48:34 2014 +@@ -27,7 +27,7 @@ + #include "file.h" + + #ifndef lint +-FILE_RCSID("@(#)$File: funcs.c,v 1.67 2014/02/12 23:20:53 christos Exp $") ++FILE_RCSID("@(#)$File: funcs.c,v 1.68 2014/02/18 11:09:31 kim Exp $") + #endif /* lint */ + + #include "magic.h" @@ -41,79 +41,79 @@ #if defined(HAVE_WCTYPE_H) #include <wctype.h> @@ -1947,7 +1970,26 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c { int m = 0, rv = 0, looks_text = 0; int mime = ms->flags & MAGIC_MIME; -@@ -203,10 +202,10 @@ +@@ -174,8 +173,7 @@ + const char *code_mime = "binary"; + const char *type = "application/octet-stream"; + const char *def = "data"; +- +- ++ const char *ftype = NULL; + + if (nb == 0) { + def = "empty"; +@@ -188,7 +186,7 @@ + + if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) { + looks_text = file_encoding(ms, ubuf, nb, &u8buf, &ulen, +- &code, &code_mime, &type); ++ &code, &code_mime, &ftype); + } + + #ifdef __EMX__ +@@ -203,10 +201,10 @@ } } #endif @@ -1961,7 +2003,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c if ((ms->flags & MAGIC_DEBUG) != 0) (void)fprintf(stderr, "zmagic %d\n", m); goto done_encoding; -@@ -221,12 +220,17 @@ +@@ -221,12 +219,17 @@ } /* Check if we have a CDF file */ @@ -1984,7 +2026,16 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c /* try soft magic tests */ if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0) -@@ -300,7 +304,6 @@ +@@ -268,7 +271,7 @@ + if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) { + if (looks_text == 0) + if ((m = file_ascmagic_with_encoding( ms, ubuf, +- nb, u8buf, ulen, code, type, looks_text)) ++ nb, u8buf, ulen, code, ftype, looks_text)) + != 0) { + if ((ms->flags & MAGIC_DEBUG) != 0) + (void)fprintf(stderr, +@@ -300,7 +303,6 @@ return m; } @@ -1992,7 +2043,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c protected int file_reset(struct magic_set *ms) -@@ -310,11 +313,11 @@ +@@ -310,11 +312,11 @@ return -1; } if (ms->o.buf) { @@ -2006,7 +2057,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c ms->o.pbuf = NULL; } ms->event_flags &= ~EVENT_HAD_ERR; -@@ -333,7 +336,7 @@ +@@ -333,7 +335,7 @@ protected const char * file_getbuffer(struct magic_set *ms) { @@ -2015,7 +2066,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c size_t psize, len; if (ms->event_flags & EVENT_HAD_ERR) -@@ -348,15 +351,13 @@ +@@ -348,15 +350,13 @@ /* * 4 is for octal representation, + 1 is for NUL */ len = strlen(ms->o.buf); if (len > (SIZE_MAX - 1) / 4) { @@ -2032,7 +2083,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c #if defined(HAVE_WCHAR_H) && defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH) { -@@ -416,8 +417,8 @@ +@@ -416,8 +416,8 @@ if (level >= ms->c.len) { len = (ms->c.len += 20) * sizeof(*ms->c.li); ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ? @@ -2043,7 +2094,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c if (ms->c.li == NULL) { file_oomem(ms, len); return -1; -@@ -437,32 +438,50 @@ +@@ -437,32 +437,50 @@ return ms->o.buf == NULL ? 0 : strlen(ms->o.buf); } @@ -2706,7 +2757,7 @@ diff -u libmagic.orig/print.c libmagic/print.c } diff -u libmagic.orig/readcdf.c libmagic/readcdf.c --- libmagic.orig/readcdf.c Tue Jan 7 04:13:42 2014 -+++ libmagic/readcdf.c Thu Jun 5 18:05:33 2014 ++++ libmagic/readcdf.c Sat Oct 25 11:50:04 2014 @@ -26,11 +26,15 @@ #include "file.h" @@ -2724,7 +2775,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c #include <string.h> #include <time.h> #include <ctype.h> -@@ -69,6 +73,44 @@ +@@ -69,6 +73,50 @@ { NULL, NULL, }, }; @@ -2743,6 +2794,9 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c + { 0x00000000000c1084LLU, 0x46000000000000c0LLU }, +#endif + "x-msi", ++ }, ++ { { 0, 0 }, ++ NULL, + } +}, clsid2desc[] = { + { @@ -2753,6 +2807,9 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c +#endif + "MSI Installer", + }, ++ { { 0, 0 }, ++ NULL, ++ } +}; + +private const char * @@ -2769,7 +2826,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c private const char * cdf_app_to_mime(const char *vbuf, const struct nv *nv) { -@@ -87,16 +129,21 @@ +@@ -87,16 +135,21 @@ private int cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info, @@ -2793,7 +2850,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c for (i = 0; i < count; i++) { cdf_print_property_name(buf, sizeof(buf), info[i].pi_id); switch (info[i].pi_type) { -@@ -153,7 +200,7 @@ +@@ -153,7 +206,7 @@ buf, vbuf) == -1) return -1; } @@ -2802,7 +2859,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c CDF_PROPERTY_NAME_OF_APPLICATION) { str = cdf_app_to_mime(vbuf, app2mime); } -@@ -162,8 +209,12 @@ +@@ -162,8 +215,12 @@ case CDF_FILETIME: tp = info[i].pi_tp; if (tp != 0) { @@ -2817,7 +2874,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c cdf_print_elapsed_time(tbuf, sizeof(tbuf), tp); if (NOTMIME(ms) && file_printf(ms, -@@ -171,8 +222,11 @@ +@@ -171,8 +228,11 @@ return -1; } else { char *c, *ec; @@ -2831,7 +2888,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c if (c != NULL && (ec = strchr(c, '\n')) != NULL) *ec = '\0'; -@@ -200,7 +254,7 @@ +@@ -200,7 +260,7 @@ private int cdf_file_summary_info(struct magic_set *ms, const cdf_header_t *h, @@ -2840,7 +2897,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c { cdf_summary_info_header_t si; cdf_property_info_t *info; -@@ -211,6 +265,8 @@ +@@ -211,6 +271,8 @@ return -1; if (NOTMIME(ms)) { @@ -2849,7 +2906,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c if (file_printf(ms, "Composite Document File V2 Document") == -1) return -1; -@@ -238,9 +294,15 @@ +@@ -238,9 +300,15 @@ return -2; break; } @@ -2867,7 +2924,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c free(info); return m == -1 ? -2 : m; -@@ -258,6 +320,7 @@ +@@ -258,6 +326,7 @@ int i; const char *expn = ""; const char *corrupt = "corrupt: "; @@ -2875,7 +2932,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c info.i_fd = fd; info.i_buf = buf; -@@ -291,7 +354,8 @@ +@@ -291,7 +360,8 @@ goto out2; } @@ -2885,7 +2942,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c expn = "Cannot read short stream"; goto out3; } -@@ -312,23 +376,21 @@ +@@ -312,23 +382,21 @@ #ifdef CDF_DEBUG cdf_dump_summary_info(&h, &scn); #endif @@ -2918,7 +2975,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c if (str != NULL) { diff -u libmagic.orig/readelf.c libmagic/readelf.c --- libmagic.orig/readelf.c Tue Nov 5 16:44:01 2013 -+++ libmagic/readelf.c Fri Feb 21 00:21:27 2014 ++++ libmagic/readelf.c Sat Oct 25 11:50:04 2014 @@ -48,8 +48,8 @@ private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t, off_t, int *, int); @@ -2983,7 +3040,21 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badread(ms); return -1; } -@@ -913,24 +928,12 @@ +@@ -477,6 +492,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; + +@@ -913,24 +935,12 @@ return 0; } @@ -3011,7 +3082,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badread(ms); return -1; } -@@ -955,14 +958,17 @@ +@@ -955,14 +965,17 @@ /* Things we can determine when we seek */ switch (xsh_type) { case SHT_NOTE: @@ -3034,7 +3105,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c return -1; } -@@ -971,25 +977,16 @@ +@@ -971,25 +984,16 @@ if (noff >= (off_t)xsh_size) break; noff = donote(ms, nbuf, (size_t)noff, @@ -3065,7 +3136,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badseek(ms); return -1; } -@@ -1001,7 +998,7 @@ +@@ -1001,7 +1005,7 @@ MAX(sizeof cap32, sizeof cap64)]; if ((coff += xcap_sizeof) > (off_t)xsh_size) break; @@ -3074,7 +3145,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c (ssize_t)xcap_sizeof) { file_badread(ms); return -1; -@@ -1027,13 +1024,12 @@ +@@ -1027,13 +1031,12 @@ break; } } @@ -3090,7 +3161,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (file_printf(ms, ", %sstripped", stripped ? "" : "not ") == -1) return -1; if (cap_hw1) { -@@ -1112,7 +1108,7 @@ +@@ -1112,7 +1115,7 @@ const char *shared_libraries = ""; unsigned char nbuf[BUFSIZ]; ssize_t bufsize; @@ -3099,7 +3170,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (size != xph_sizeof) { if (file_printf(ms, ", corrupted program header size") == -1) -@@ -1121,8 +1117,13 @@ +@@ -1121,8 +1124,13 @@ } for ( ; num; num--) { @@ -3115,7 +3186,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c return -1; } -@@ -1160,9 +1161,12 @@ +@@ -1160,9 +1168,12 @@ * This is a PT_NOTE section; loop through all the notes * in the section. */ @@ -3131,7 +3202,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (bufsize == -1) { file_badread(ms); return -1; -@@ -1223,7 +1227,7 @@ +@@ -1223,7 +1234,7 @@ /* * If we cannot seek, it must be a pipe, socket or fifo. */ @@ -3163,7 +3234,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 Feb 13 00:20:53 2014 -+++ libmagic/softmagic.c Tue Jul 1 08:57:25 2014 ++++ libmagic/softmagic.c Mon Aug 4 14:58:55 2014 @@ -50,6 +50,11 @@ #include <locale.h> #endif @@ -3176,6 +3247,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 *, +@@ -62,7 +67,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 *); @@ -71,7 +76,8 @@ private void cvt_32(union VALUETYPE *, const struct magic *); private void cvt_64(union VALUETYPE *, const struct magic *); @@ -3320,9 +3400,72 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c while (len--) *ptr1++ = *ptr2++; *ptr1 = '\0'; -@@ -1178,9 +1170,6 @@ - "nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o, - nbytes, count); +@@ -1046,7 +1038,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 +@@ -1066,15 +1058,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 *, +@@ -1087,7 +1088,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; +@@ -1158,7 +1159,6 @@ + int *need_separator, int *returnval) + { + uint32_t soffset, offset = ms->offset; +- uint32_t count = m->str_range; + int rv, oneed_separator, in_type; + char *sbuf, *rbuf; + union VALUETYPE *p = &ms->ms_value; +@@ -1170,17 +1170,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); @@ -3330,7 +3473,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } if (m->flag & INDIR) { -@@ -1679,9 +1668,6 @@ +@@ -1672,16 +1668,13 @@ + 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)); @@ -3340,7 +3491,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } } -@@ -1755,11 +1741,21 @@ +@@ -1755,11 +1748,21 @@ ms->offset = soffset; if (rv == 1) { if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && @@ -3365,7 +3516,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } return rv; -@@ -1875,6 +1871,42 @@ +@@ -1875,6 +1878,42 @@ return file_strncmp(a, b, len, flags); } @@ -3408,7 +3559,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private int magiccheck(struct magic_set *ms, struct magic *m) { -@@ -2035,63 +2067,151 @@ +@@ -2035,63 +2074,151 @@ break; } case FILE_REGEX: { @@ -3444,7 +3595,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/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index ce747378a..543bce508 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -1272,7 +1272,7 @@ file_signextend(struct magic_set *ms, struct magic *m, uint64_t v) * the sign extension must have happened. */ case FILE_BYTE: - v = (char) v; + v = (signed char) v; break; case FILE_SHORT: case FILE_BESHORT: diff --git a/ext/fileinfo/libmagic/readcdf.c b/ext/fileinfo/libmagic/readcdf.c index ec97ced44..175719a2d 100644 --- a/ext/fileinfo/libmagic/readcdf.c +++ b/ext/fileinfo/libmagic/readcdf.c @@ -88,6 +88,9 @@ static const struct cv { { 0x00000000000c1084LLU, 0x46000000000000c0LLU }, #endif "x-msi", + }, + { { 0, 0 }, + NULL, } }, clsid2desc[] = { { @@ -98,6 +101,9 @@ static const struct cv { #endif "MSI Installer", }, + { { 0, 0 }, + NULL, + } }; private const char * diff --git a/ext/fileinfo/libmagic/readelf.c b/ext/fileinfo/libmagic/readelf.c index 6f776721b..4620711e8 100644 --- a/ext/fileinfo/libmagic/readelf.c +++ b/ext/fileinfo/libmagic/readelf.c @@ -492,6 +492,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 f67e80bf8..7bf0b757a 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -5118,11 +5118,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/gd/tests/bug48801_1.phpt b/ext/gd/tests/bug48801_1.phpt index ef2aa1dba..0ab6d7cdd 100644 --- a/ext/gd/tests/bug48801_1.phpt +++ b/ext/gd/tests/bug48801_1.phpt @@ -1,13 +1,12 @@ --TEST-- -Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10 and < 2.4.12 +Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10 --SKIPIF-- <?php if(!extension_loaded('gd')){ die('skip gd extension not available'); } if(!function_exists('imageftbbox')) die('skip imageftbbox() not available'); include dirname(__FILE__) . '/func.inc'; - if(version_compare(get_freetype_version(), '2.4.10') < 0) die('skip for freetype >= 2.4.10'); - if(version_compare(get_freetype_version(), '2.4.12') >= 0) die('skip for freetype < 2.4.12'); + if(version_compare(get_freetype_version(), '2.4.10') == -1) die('skip for freetype >= 2.4.10'); ?> --FILE-- <?php @@ -21,6 +20,6 @@ echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n"; ?> --EXPECTF-- (-1, 15) -(156, 15) -(156, -48) +(15%d, 15) +(15%d, -48) (-1, -48) diff --git a/ext/gd/tests/bug48801_2.phpt b/ext/gd/tests/bug48801_2.phpt deleted file mode 100644 index b2a719fa0..000000000 --- a/ext/gd/tests/bug48801_2.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.12 ---SKIPIF-- -<?php - if(!extension_loaded('gd')){ die('skip gd extension not available'); } - if(!function_exists('imageftbbox')) die('skip imageftbbox() not available'); - - include dirname(__FILE__) . '/func.inc'; - if(version_compare(get_freetype_version(), '2.4.12') < 0) die('skip for freetype >= 2.4.12'); -?> ---FILE-- -<?php -$cwd = dirname(__FILE__); -$font = "$cwd/Tuffy.ttf"; -$bbox = imageftbbox(50, 0, $font, "image"); -echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n"; -echo '(' . $bbox[2] . ', ' . $bbox[3] . ")\n"; -echo '(' . $bbox[4] . ', ' . $bbox[5] . ")\n"; -echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n"; -?> ---EXPECTF-- -(-1, 15) -(155, 15) -(155, -48) -(-1, -48) diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index bad610c0b..e9c1ad341 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -104,6 +104,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_random, 0, 0, 0) ZEND_ARG_INFO(0, limiter) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_random_bits, 0, 0, 1) + ZEND_ARG_INFO(0, bits) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_random_range, 0, 0, 2) + ZEND_ARG_INFO(0, min) + ZEND_ARG_INFO(0, max) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_setbit, 0, 0, 2) ZEND_ARG_INFO(0, a) ZEND_ARG_INFO(0, index) @@ -161,6 +170,8 @@ const zend_function_entry gmp_functions[] = { ZEND_FE(gmp_cmp, arginfo_gmp_binary) ZEND_FE(gmp_sign, arginfo_gmp_unary) ZEND_FE(gmp_random, arginfo_gmp_random) + ZEND_FE(gmp_random_bits, arginfo_gmp_random_bits) + ZEND_FE(gmp_random_range, arginfo_gmp_random_range) ZEND_FE(gmp_and, arginfo_gmp_binary) ZEND_FE(gmp_or, arginfo_gmp_binary) ZEND_FE(gmp_com, arginfo_gmp_unary) @@ -352,30 +363,6 @@ static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_una #define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) #define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) -/* {{{ 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); -} -/* }}} */ - static inline long gmp_get_long(zval *zv) /* {{{ */ { if (Z_TYPE_P(zv) == IS_LONG) { @@ -723,8 +710,6 @@ ZEND_MINIT_FUNCTION(gmp) REGISTER_LONG_CONSTANT("GMP_BIG_ENDIAN", GMP_BIG_ENDIAN, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("GMP_NATIVE_ENDIAN", GMP_NATIVE_ENDIAN, CONST_CS | CONST_PERSISTENT); - mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree); - return SUCCESS; } /* }}} */ @@ -1784,6 +1769,22 @@ ZEND_FUNCTION(gmp_sign) } /* }}} */ +static void gmp_init_random(TSRMLS_D) +{ + if (!GMPG(rand_initialized)) { + /* Initialize */ +#if GMP_42_OR_NEWER + gmp_randinit_mt(GMPG(rand_state)); +#else + gmp_randinit_lc_2exp(GMPG(rand_state), 32L); +#endif + /* Seed */ + gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED()); + + GMPG(rand_initialized) = 1; + } +} + /* {{{ proto GMP gmp_random([int limiter]) Gets random number */ ZEND_FUNCTION(gmp_random) @@ -1796,16 +1797,8 @@ ZEND_FUNCTION(gmp_random) } INIT_GMP_RETVAL(gmpnum_result); + gmp_init_random(TSRMLS_C); - if (!GMPG(rand_initialized)) { - /* Initialize */ - gmp_randinit_lc_2exp_size(GMPG(rand_state), 32L); - - /* Seed */ - gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED()); - - GMPG(rand_initialized) = 1; - } #ifdef GMP_LIMB_BITS mpz_urandomb(gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * GMP_LIMB_BITS); #else @@ -1814,6 +1807,91 @@ ZEND_FUNCTION(gmp_random) } /* }}} */ +/* {{{ proto GMP gmp_random_bits(int bits) + Gets a random number in the range 0 to (2 ** n) - 1 */ +ZEND_FUNCTION(gmp_random_bits) +{ + long bits; + mpz_ptr gmpnum_result; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &bits) == FAILURE) { + return; + } + + if (bits <= 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The number of bits must be positive"); + RETURN_FALSE; + } + + INIT_GMP_RETVAL(gmpnum_result); + gmp_init_random(TSRMLS_C); + + mpz_urandomb(gmpnum_result, GMPG(rand_state), bits); +} +/* }}} */ + +/* {{{ proto GMP gmp_random_range(mixed min, mixed max) + Gets a random number in the range min to max */ +ZEND_FUNCTION(gmp_random_range) +{ + zval *min_arg, *max_arg; + mpz_ptr gmpnum_min, gmpnum_max, gmpnum_result; + gmp_temp_t temp_a, temp_b; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &min_arg, &max_arg) == FAILURE) { + return; + } + + gmp_init_random(TSRMLS_C); + + FETCH_GMP_ZVAL(gmpnum_max, max_arg, temp_a); + + if (Z_TYPE_P(min_arg) == IS_LONG && Z_LVAL_P(min_arg) >= 0) { + if (mpz_cmp_ui(gmpnum_max, Z_LVAL_P(min_arg)) <= 0) { + FREE_GMP_TEMP(temp_a); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The minimum value must be less than the maximum value"); + RETURN_FALSE; + } + + INIT_GMP_RETVAL(gmpnum_result); + + if (Z_LVAL_P(min_arg)) { + mpz_sub_ui(gmpnum_max, gmpnum_max, Z_LVAL_P(min_arg)); + } + + mpz_add_ui(gmpnum_max, gmpnum_max, 1); + mpz_urandomm(gmpnum_result, GMPG(rand_state), gmpnum_max); + + if (Z_LVAL_P(min_arg)) { + mpz_add_ui(gmpnum_result, gmpnum_result, Z_LVAL_P(min_arg)); + } + + FREE_GMP_TEMP(temp_a); + + } + else { + FETCH_GMP_ZVAL_DEP(gmpnum_min, min_arg, temp_b, temp_a); + + if (mpz_cmp(gmpnum_max, gmpnum_min) <= 0) { + FREE_GMP_TEMP(temp_b); + FREE_GMP_TEMP(temp_a); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The minimum value must be less than the maximum value"); + RETURN_FALSE; + } + + INIT_GMP_RETVAL(gmpnum_result); + + mpz_sub(gmpnum_max, gmpnum_max, gmpnum_min); + mpz_add_ui(gmpnum_max, gmpnum_max, 1); + mpz_urandomm(gmpnum_result, GMPG(rand_state), gmpnum_max); + mpz_add(gmpnum_result, gmpnum_result, gmpnum_min); + + FREE_GMP_TEMP(temp_b); + FREE_GMP_TEMP(temp_a); + } +} +/* }}} */ + /* {{{ proto GMP gmp_and(mixed a, mixed b) Calculates logical AND of a and b */ ZEND_FUNCTION(gmp_and) diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h index b3706c534..a1a1dc262 100644 --- a/ext/gmp/php_gmp.h +++ b/ext/gmp/php_gmp.h @@ -66,6 +66,8 @@ ZEND_FUNCTION(gmp_or); ZEND_FUNCTION(gmp_com); ZEND_FUNCTION(gmp_xor); ZEND_FUNCTION(gmp_random); +ZEND_FUNCTION(gmp_random_bits); +ZEND_FUNCTION(gmp_random_range); ZEND_FUNCTION(gmp_setbit); ZEND_FUNCTION(gmp_clrbit); ZEND_FUNCTION(gmp_scan0); diff --git a/ext/gmp/tests/gmp_random_bits.phpt b/ext/gmp/tests/gmp_random_bits.phpt new file mode 100644 index 000000000..21d493cdb --- /dev/null +++ b/ext/gmp/tests/gmp_random_bits.phpt @@ -0,0 +1,45 @@ +--TEST-- +gmp_random_bits() basic tests +--SKIPIF-- +<?php if (!extension_loaded("gmp")) print "skip"; ?> +--FILE-- +<?php + +var_dump(gmp_random_bits()); +var_dump(gmp_random_bits(0)); +var_dump(gmp_random_bits(-1)); + +// If these error the test fails. +gmp_random_bits(1); +gmp_random_bits(1024); + +// 2 seconds to make sure the numbers stay in range +$start = microtime(true); +$limit = (2 ** 30) - 1; +while (1) { + for ($i = 0; $i < 5000; $i++) { + $result = gmp_random_bits(30); + if ($result < 0 || $result > $limit) { + print "RANGE VIOLATION\n"; + var_dump($result); + break 2; + } + } + + if (microtime(true) - $start > 2) { + break; + } +} + +echo "Done\n"; +?> +--EXPECTF-- +Warning: gmp_random_bits() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: gmp_random_bits(): The number of bits must be positive in %s on line %d +bool(false) + +Warning: gmp_random_bits(): The number of bits must be positive in %s on line %d +bool(false) +Done diff --git a/ext/gmp/tests/gmp_random_range.phpt b/ext/gmp/tests/gmp_random_range.phpt new file mode 100644 index 000000000..a8e7c4a9c --- /dev/null +++ b/ext/gmp/tests/gmp_random_range.phpt @@ -0,0 +1,81 @@ +--TEST-- +gmp_random_range() basic tests +--SKIPIF-- +<?php if (!extension_loaded("gmp")) print "skip"; ?> +--FILE-- +<?php + +$minusTen = gmp_init(-1); +$plusTen = gmp_init(1); +$zero = gmp_init(0); + +var_dump(gmp_random_range()); +var_dump(gmp_random_range(10)); +var_dump(gmp_random_range(10, -10)); + +var_dump(gmp_random_range($plusTen, $minusTen)); +var_dump(gmp_random_range($plusTen, $zero)); + +// If these error the test fails. +gmp_random_range(0, 10); +gmp_random_range(1, 10); +gmp_random_range(-1, 10); +gmp_random_range(-10, 0); +gmp_random_range(-10, -1); + +gmp_random_range(0, $plusTen); +gmp_random_range(1, $plusTen); +gmp_random_range(-1, $plusTen); + +gmp_random_range($zero, $plusTen); +gmp_random_range($minusTen, $plusTen); + +// 2 seconds to make sure the numbers stay in range +$start = microtime(true); +while (1) { + for ($i = 0; $i < 5000; $i++) { + $result = gmp_random_range(0, 1000); + if ($result < 0 || $result > 1000) { + print "RANGE VIOLATION 1\n"; + var_dump($result); + break 2; + } + + $result = gmp_random_range(-1000, 0); + if ($result < -1000 || $result > 0) { + print "RANGE VIOLATION 2\n"; + var_dump($result); + break 2; + } + + $result = gmp_random_range(-500, 500); + if ($result < -500 || $result > 500) { + print "RANGE VIOLATION 3\n"; + var_dump($result); + break 2; + } + } + + if (microtime(true) - $start > 2) { + break; + } +} + +echo "Done\n"; +?> +--EXPECTF-- +Warning: gmp_random_range() expects exactly 2 parameters, 0 given in %s on line %d +NULL + +Warning: gmp_random_range() expects exactly 2 parameters, 1 given in %s on line %d +NULL + +Warning: gmp_random_range(): The minimum value must be less than the maximum value in %s on line %d +bool(false) + +Warning: gmp_random_range(): The minimum value must be less than the maximum value in %s on line %d +bool(false) + +Warning: gmp_random_range(): The minimum value must be less than the maximum value in %s on line %d +bool(false) +Done diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 50055a25a..8a141c006 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -391,6 +391,23 @@ static int _get_lderrno(LDAP *ldap) } /* }}} */ +/* {{{ _set_lderrno + */ +static void _set_lderrno(LDAP *ldap, int lderr) +{ +#if !HAVE_NSLDAP +#if LDAP_API_VERSION > 2000 || HAVE_ORALDAP + /* New versions of OpenLDAP do it this way */ + ldap_set_option(ldap, LDAP_OPT_ERROR_NUMBER, &lderr); +#else + ldap->ld_errno = lderr; +#endif +#else + ldap_set_lderrno(ldap, lderr, NULL, NULL); +#endif +} +/* }}} */ + /* {{{ proto bool ldap_bind(resource link [, string dn [, string password]]) Bind to LDAP directory */ PHP_FUNCTION(ldap_bind) @@ -405,18 +422,20 @@ PHP_FUNCTION(ldap_bind) RETURN_FALSE; } + ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); + if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) { + _set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS); php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN contains a null byte"); RETURN_FALSE; } if (ldap_bind_pw != NULL && memchr(ldap_bind_pw, '\0', ldap_bind_pwlen) != NULL) { + _set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Password contains a null byte"); RETURN_FALSE; } - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); - if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc)); RETURN_FALSE; diff --git a/ext/mysqlnd/config9.m4 b/ext/mysqlnd/config9.m4 index 78e1bf1df..8f749cf27 100644 --- a/ext/mysqlnd/config9.m4 +++ b/ext/mysqlnd/config9.m4 @@ -58,12 +58,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 19f9fe4eb..b9bee9676 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 000000000..3bc18125a --- /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/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 30705ff18..41dde0508 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -252,6 +252,9 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { break; } } + if (Z_TYPE(c) == IS_CONSTANT_AST) { + break; + } literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); replace_tmp_by_const(op_array, opline, tv, &c TSRMLS_CC); @@ -303,6 +306,9 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)) + 1, (void **) &c) == SUCCESS) { + if (Z_TYPE_PP(c) == IS_CONSTANT_AST) { + break; + } if (ZEND_IS_CONSTANT_TYPE(Z_TYPE_PP(c))) { if (!zend_get_persistent_constant(Z_STRVAL_PP(c), Z_STRLEN_PP(c), &t, 1 TSRMLS_CC) || ZEND_IS_CONSTANT_TYPE(Z_TYPE(t))) { diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4 index a97114f80..701e48838 100644 --- a/ext/openssl/config0.m4 +++ b/ext/openssl/config0.m4 @@ -8,6 +8,9 @@ PHP_ARG_WITH(openssl, for OpenSSL support, PHP_ARG_WITH(kerberos, for Kerberos support, [ --with-kerberos[=DIR] OPENSSL: Include Kerberos support], no, no) +PHP_ARG_WITH(system-ciphers, whether to use system default cipher list instead of hardcoded value, +[ --with-system-ciphers OPENSSL: Use system default cipher list instead of hardcoded value], no, no) + if test "$PHP_OPENSSL" != "no"; then PHP_NEW_EXTENSION(openssl, openssl.c xp_ssl.c, $ext_shared) PHP_SUBST(OPENSSL_SHARED_LIBADD) @@ -25,4 +28,7 @@ if test "$PHP_OPENSSL" != "no"; then ], [ AC_MSG_ERROR([OpenSSL check failed. Please check config.log for more information.]) ]) + if test "$PHP_SYSTEM_CIPHERS" != "no"; then + AC_DEFINE(USE_OPENSSL_SYSTEM_CIPHERS,1,[ Use system default cipher list instead of hardcoded value ]) + fi fi diff --git a/ext/openssl/tests/bug65729.pem b/ext/openssl/tests/bug65729.pem index f0d44a4c7..918445712 100644 --- a/ext/openssl/tests/bug65729.pem +++ b/ext/openssl/tests/bug65729.pem @@ -1,28 +1,32 @@ ------BEGIN CERTIFICATE----- -MIICCTCCAXICCQCx2JwIhbRefzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJT -RzESMBAGA1UECBMJVGVzdHZpbGxlMREwDwYDVQQKEwhkYXRpYmJhdzETMBEGA1UE -AxQKKi50ZXN0LmNvbTAeFw0xNDA5MjQxMTMzNTRaFw0yNDA5MjExMTMzNTRaMEkx -CzAJBgNVBAYTAlNHMRIwEAYDVQQIEwlUZXN0dmlsbGUxETAPBgNVBAoTCGRhdGli -YmF3MRMwEQYDVQQDFAoqLnRlc3QuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB -iQKBgQDBnR8DYzsN90kISI87kBvw40TQknS7/fuymWCmSrtRQLED8p2QL8PiYCZ8 -UdcFVsv+di7MJvUOzW6dRo2DCu8Rojx3ML8dAtPsQkDdaCXDnOvCTQCAqFmxa1A9 -c5kp0hbzCrucKGckb355A4NumFgX1fjQ705MfjGPgQef1ZtozQIDAQABMA0GCSqG -SIb3DQEBBQUAA4GBAGP07nJo0pI4FdsXuAHWr97XxV4EhHopFMw6svOZ3UtsRzmW -ScmmMdgd3c8ciVxOsztgnzvFq/nrUkw/3n/Xz/gtE7kZt9aS18SnCyyHPJcXmmUE -NsbyZ/7srIqCSrxUkP+N//nToqHxg1pqA/A8RzOOQUAp+UIVF6Zl/kkFNgt8 ------END CERTIFICATE----- -----BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDBnR8DYzsN90kISI87kBvw40TQknS7/fuymWCmSrtRQLED8p2Q -L8PiYCZ8UdcFVsv+di7MJvUOzW6dRo2DCu8Rojx3ML8dAtPsQkDdaCXDnOvCTQCA -qFmxa1A9c5kp0hbzCrucKGckb355A4NumFgX1fjQ705MfjGPgQef1ZtozQIDAQAB -AoGADAnkAsbpxh2JKf2xAkgcpKbNAZcJsSLCwsEstEpTSWMXXqJ4T53YtTu7SOGh -2BAkkQbyM/l8JVZ6uUbIx8wnPzqAuB2hEDQHKZVyftDyJh+54Uyz0xV0JdWGWrFh -A+uDt/Zncx2g+qlkQG5J5nHnrd9OAns89wJXpBWA6twlsuECQQD/HC4wxOJzh1XI -YSWHWQulOnlNgZ2zERfmJeRfJ0ncmDOV2ofxOFQ+dMJ36XghPaH52KdxqWI1yQaE -yesx8ygFAkEAwkoF4lBuYdsXucJNDYf8o9MlBvazoriH0y26B/YozJ7iAEFqVvcC -TN+iKDIyiRALwR6a3nzhyFYJ4xyzgSIAKQJBAMnw3seQMsnM6aTS8cgwPr2uifNG -lTT4ZPi0KhEAosFSYhNPh6j1NAq0lnQhhgyaIywJypJ4yNtWpChdRiamGpkCQQDB -iUExPpOmMLwCk7VzrCmS+6pftHIevpi2WU99zMy5f+969665MFb/QqniRpamh/Bd -kGIPDPFQQbyZmqaJFNh5AkEAzy0YVbUT3C/QvstPr5i7ztj7WiW/1zJMamFwY/ZS -1J7e7lqHgRICie5uv1Yvh3w/qmV/7lTLhmlQZd9SJMpXhg== +MIICXgIBAAKBgQDU8RgB8O2uR3ApjlxEX5rpCI+gIaZ3h0RBAF9rNA/s0pPTtX/e +NGJgDyuT/TF6mcv0I/0/s2WSmIE50NW6tgWZ7RoBdVw/MiByPt6vK1aDrggbycN/ +C6RrxrEsdZe3E9CDZCFM1br8/8tnV19Ju80g8zY2MgDjAjSkeXN5yp3kgQIDAQAB +AoGBANFKKRt3TlRVmHLvndYB1YKmzGtJx5CBXV85247FO8W67lpNcGDYQbxCDMXG +PARQ9vl9CeK7EuDzjUdi7z40uujUOJtsLbMP6ikwKFi/tA2cW1yoLionZ3JkfyEr +4Uu8kkkIut0VLX8uuVz/Y03lt8Uzc+GvD2DPhkSQn80f10SFAkEA94EcjwFcwuVi +QofgOPbf7qfOoWDsXYhlMU9g1CaPJiMcMcvgoLK3V514oMDxlkvuLujlYeG9NvRS +tREluGsbywJBANxARX5MSzAkFRNZNZKDUvifdC0BA2Dqzd2iOJRcTdcebGENd7+e +oub/9lVLGrX7T4U2en8IXwJV4UHxwoQLz2MCQQCI1Bj8ui0VFgj/bOy5sUnVP3IN +Z27kuo3u98o5HuQOmmRw5xxU2thfGJBilqg4hdu0lU6SkWCwq9u5fDRVQumHAkAM +mJBg3LQgGLAr3xo1OtVv6o6WVEyBKmyDlFdwBKde+hpwoniKuOPQGitYTWdFqQ2v +LKJsyWnFlGvBfbYGHzbJAkEA17SgCf7Wx7NxuLCSMj/rd25ul0jlIrjx6+/HfyLb ++T2SXXU4g2DBiPngrfJ9jX8QGoLpZiBGcwX3QxssX5FgJQ== -----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICvDCCAiWgAwIBAgIJANOyJnvPEioVMA0GCSqGSIb3DQEBBQUAMEkxCzAJBgNV +BAYTAlNHMRIwEAYDVQQIEwlUZXN0dmlsbGUxETAPBgNVBAoTCGRhdGliYmF3MRMw +EQYDVQQDFAoqLnRlc3QuY29tMB4XDTE0MTAxNTEzMDg1OFoXDTM0MTAxMDEzMDg1 +OFowSTELMAkGA1UEBhMCU0cxEjAQBgNVBAgTCVRlc3R2aWxsZTERMA8GA1UEChMI +ZGF0aWJiYXcxEzARBgNVBAMUCioudGVzdC5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD +gY0AMIGJAoGBANTxGAHw7a5HcCmOXERfmukIj6AhpneHREEAX2s0D+zSk9O1f940 +YmAPK5P9MXqZy/Qj/T+zZZKYgTnQ1bq2BZntGgF1XD8yIHI+3q8rVoOuCBvJw38L +pGvGsSx1l7cT0INkIUzVuvz/y2dXX0m7zSDzNjYyAOMCNKR5c3nKneSBAgMBAAGj +gaswgagwHQYDVR0OBBYEFErHO0eHLp9YvBWVvvhty/jGie5wMHkGA1UdIwRyMHCA +FErHO0eHLp9YvBWVvvhty/jGie5woU2kSzBJMQswCQYDVQQGEwJTRzESMBAGA1UE +CBMJVGVzdHZpbGxlMREwDwYDVQQKEwhkYXRpYmJhdzETMBEGA1UEAxQKKi50ZXN0 +LmNvbYIJANOyJnvPEioVMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEA +gMv2HUUp0FMTYQ6tL9YgNUNARukxJzGDWweo4/YuNSgI+Ljpye4Nf1MpyDWfhZGc +QbUhfm5CdEvcBzZBtI0lLXs61yGdLnDH/6QHViXP2rlH0yeAABw8+wSdxuiZN1yR +ed4pNXU+tczgW2Ri2+T0ScOZd0XommKHrQnu2T9mMBY= +-----END CERTIFICATE----- diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index a74a09071..debd1f16d 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1476,13 +1476,16 @@ int php_openssl_setup_crypto(php_stream *stream, } GET_VER_OPT_STRING("ciphers", cipherlist); +#ifndef USE_OPENSSL_SYSTEM_CIPHERS if (!cipherlist) { cipherlist = OPENSSL_DEFAULT_STREAM_CIPHERS; } - if (SSL_CTX_set_cipher_list(sslsock->ctx, cipherlist) != 1) { - return FAILURE; +#endif + if (cipherlist) { + if (SSL_CTX_set_cipher_list(sslsock->ctx, cipherlist) != 1) { + return FAILURE; + } } - if (FAILURE == set_local_cert(sslsock->ctx, stream TSRMLS_CC)) { return FAILURE; } diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 96f6fa7f7..657218d00 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -1058,10 +1058,16 @@ static PHP_METHOD(PDO, pgsqlGetNotify) if (result_type == PDO_FETCH_NUM || result_type == PDO_FETCH_BOTH) { add_index_string(return_value, 0, pgsql_notify->relname, 1); add_index_long(return_value, 1, pgsql_notify->be_pid); + if (pgsql_notify->extra && pgsql_notify->extra[0]) { + add_index_string(return_value, 2, pgsql_notify->extra, 1); + } } if (result_type == PDO_FETCH_ASSOC || result_type == PDO_FETCH_BOTH) { add_assoc_string(return_value, "message", pgsql_notify->relname, 1); add_assoc_long(return_value, "pid", pgsql_notify->be_pid); + if (pgsql_notify->extra && pgsql_notify->extra[0]) { + add_assoc_string(return_value, "payload", pgsql_notify->extra, 1); + } } PQfreemem(pgsql_notify); diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 35e69a3c0..7da130d52 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -297,7 +297,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; } diff --git a/ext/pdo_pgsql/tests/bug66584.phpt b/ext/pdo_pgsql/tests/bug66584.phpt new file mode 100644 index 000000000..07742bca7 --- /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/bug68199.phpt b/ext/pdo_pgsql/tests/bug68199.phpt new file mode 100644 index 000000000..9abfba2b8 --- /dev/null +++ b/ext/pdo_pgsql/tests/bug68199.phpt @@ -0,0 +1,109 @@ +--TEST-- +Bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads) +--SKIPIF-- +<?php # vim:se ft=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(); + +$db = PDOTest::factory(); +if (version_compare($db->getAttribute(PDO::ATTR_SERVER_VERSION), '9.0.0') < 0) { + die("skip Requires 9.0+"); +} + +?> +--FILE-- +<?php +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); +$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + +// pgsqlGetPid should return something meaningful +$pid = $db->pgsqlGetPid(); +var_dump($pid > 0); + +// No listen, no notifies +var_dump($db->pgsqlGetNotify()); + +// Listen started, no notifies +$db->exec("LISTEN notifies_phpt"); +var_dump($db->pgsqlGetNotify()); + +// No parameters with payload, use default PDO::FETCH_NUM +$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_NUM); +$db->exec("NOTIFY notifies_phpt, 'payload'"); +$notify = $db->pgsqlGetNotify(); +var_dump(count($notify)); +var_dump($notify[0]); +var_dump($notify[1] == $pid); +var_dump($notify[2]); + +// No parameters with payload, use default PDO::FETCH_ASSOC +$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); +$db->exec("NOTIFY notifies_phpt, 'payload'"); +$notify = $db->pgsqlGetNotify(); +var_dump(count($notify)); +var_dump($notify['message']); +var_dump($notify['pid'] == $pid); +var_dump($notify['payload']); + +// Test PDO::FETCH_NUM as parameter with payload +$db->exec("NOTIFY notifies_phpt, 'payload'"); +$notify = $db->pgsqlGetNotify(PDO::FETCH_NUM); +var_dump(count($notify)); +var_dump($notify[0]); +var_dump($notify[1] == $pid); +var_dump($notify[2]); + +// Test PDO::FETCH_ASSOC as parameter with payload +$db->exec("NOTIFY notifies_phpt, 'payload'"); +$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC); +var_dump(count($notify)); +var_dump($notify['message']); +var_dump($notify['pid'] == $pid); +var_dump($notify['payload']); + +// Test PDO::FETCH_BOTH as parameter with payload +$db->exec("NOTIFY notifies_phpt, 'payload'"); +$notify = $db->pgsqlGetNotify(PDO::FETCH_BOTH); +var_dump(count($notify)); +var_dump($notify['message']); +var_dump($notify['pid'] == $pid); +var_dump($notify['payload']); +var_dump($notify[0]); +var_dump($notify[1] == $pid); +var_dump($notify[2]); + +// Verify that there are no notifies queued +var_dump($db->pgsqlGetNotify()); + +?> +--EXPECT-- +bool(true) +bool(false) +bool(false) +int(3) +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +int(3) +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +int(3) +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +int(3) +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +int(6) +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +bool(false) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 5bfb27888..ac6bd272c 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -3356,6 +3356,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 8e5fcadef..b2a300586 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1015,9 +1015,12 @@ static int _extension_class_string(zend_class_entry **pce TSRMLS_DC, int num_arg int *num_classes = va_arg(args, int*); if (((*pce)->type == ZEND_INTERNAL_CLASS) && (*pce)->info.internal.module && !strcasecmp((*pce)->info.internal.module->name, module->name)) { - string_printf(str, "\n"); - _class_string(str, *pce, NULL, indent TSRMLS_CC); - (*num_classes)++; + /* dump class if it is not an alias */ + if (!zend_binary_strcasecmp((*pce)->name, (*pce)->name_length, hash_key->arKey, hash_key->nKeyLength-1)) { + string_printf(str, "\n"); + _class_string(str, *pce, NULL, indent TSRMLS_CC); + (*num_classes)++; + } } return ZEND_HASH_APPLY_KEEP; } @@ -5395,12 +5398,24 @@ static int add_extension_class(zend_class_entry **pce TSRMLS_DC, int num_args, v int add_reflection_class = va_arg(args, int); if (((*pce)->type == ZEND_INTERNAL_CLASS) && (*pce)->info.internal.module && !strcasecmp((*pce)->info.internal.module->name, module->name)) { + const char *name; + int nlen; + + if (zend_binary_strcasecmp((*pce)->name, (*pce)->name_length, hash_key->arKey, hash_key->nKeyLength-1)) { + /* This is an class alias, use alias name */ + name = hash_key->arKey; + nlen = hash_key->nKeyLength-1; + } else { + /* Use class name */ + name = (*pce)->name; + nlen = (*pce)->name_length; + } if (add_reflection_class) { ALLOC_ZVAL(zclass); zend_reflection_class_factory(*pce, zclass TSRMLS_CC); - add_assoc_zval_ex(class_array, (*pce)->name, (*pce)->name_length + 1, zclass); + add_assoc_zval_ex(class_array, name, nlen+1, zclass); } else { - add_next_index_stringl(class_array, (*pce)->name, (*pce)->name_length, 1); + add_next_index_stringl(class_array, name, nlen, 1); } } return ZEND_HASH_APPLY_KEEP; @@ -6083,7 +6098,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/spl/spl_engine.h b/ext/spl/spl_engine.h index a67e60c10..473438bb7 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 f51d6c246..3a37241bf 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -2045,8 +2045,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 { @@ -2080,8 +2082,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: @@ -2259,7 +2260,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; @@ -2269,16 +2270,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 */ @@ -2469,6 +2515,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 000000000..ff41dd493 --- /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 bad4e7888..64ca97f4d 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 fed4a3b2e..63d8fbfa9 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 c68bd5234..84b3eb993 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 5d9c740c3..b472523ab 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 1f1cd580c..91266c957 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 ca14b28cc..c5392760e 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5051,7 +5051,7 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_ } /* }}} */ -void php_call_shutdown_functions(TSRMLS_D) /* {{{ */ +PHPAPI void php_call_shutdown_functions(TSRMLS_D) /* {{{ */ { if (BG(user_shutdown_function_names)) { zend_try { @@ -5063,7 +5063,7 @@ void php_call_shutdown_functions(TSRMLS_D) /* {{{ */ } /* }}} */ -void php_free_shutdown_functions(TSRMLS_D) /* {{{ */ +PHPAPI void php_free_shutdown_functions(TSRMLS_D) /* {{{ */ { if (BG(user_shutdown_function_names)) zend_try { diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index 3af85b3d4..eaeb9bca8 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -261,4 +261,8 @@ PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, siz PHPAPI extern zend_bool remove_user_shutdown_function(char *function_name, size_t function_len TSRMLS_DC); PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry TSRMLS_DC); +PHPAPI void php_call_shutdown_functions(TSRMLS_D); +PHPAPI void php_free_shutdown_functions(TSRMLS_D); + + #endif /* BASIC_FUNCTIONS_H */ diff --git a/ext/standard/image.c b/ext/standard/image.c index 02246c626..f1910d219 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -365,8 +365,8 @@ static unsigned short php_read2(php_stream * stream TSRMLS_DC) { unsigned char a[2]; - /* just return 0 if we hit the end-of-file */ - if((php_stream_read(stream, a, sizeof(a))) <= 0) return 0; + /* return 0 if we couldn't read enough data */ + if((php_stream_read(stream, a, sizeof(a))) < sizeof(a)) return 0; return (((unsigned short)a[0]) << 8) + ((unsigned short)a[1]); } @@ -646,7 +646,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC) #endif result->channels = php_read2(stream TSRMLS_CC); /* Csiz */ - if (result->channels < 0 || result->channels > 256) { + if (result->channels == 0 && php_stream_eof(stream) || result->channels > 256) { efree(result); return NULL; } diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 16a30668d..9427db90a 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -82,6 +82,13 @@ static int machine_endian_long_map[4]; static int big_endian_long_map[4]; static int little_endian_long_map[4]; +#if SIZEOF_LONG > 4 +/* Mappings of bytes from quads (64bit) for all endian environments */ +static int machine_endian_longlong_map[8]; +static int big_endian_longlong_map[8]; +static int little_endian_longlong_map[8]; +#endif + /* {{{ php_pack */ static void php_pack(zval **val, int size, int *map, char *output) @@ -98,8 +105,8 @@ static void php_pack(zval **val, int size, int *map, char *output) } /* }}} */ -/* pack() idea stolen from Perl (implemented formats behave the same as there) - * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @. +/* pack() idea stolen from Perl (implemented formats behave the same as there except J and P) + * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, q, Q, J, P, f, d, x, X, @. */ /* {{{ proto string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]]) Takes one or more arguments and packs them into a binary string according to the format argument */ @@ -199,6 +206,17 @@ PHP_FUNCTION(pack) break; /* Use as many args as specified */ + case 'q': + case 'Q': + case 'J': + case 'P': +#if SIZEOF_LONG < 8 + efree(argv); + efree(formatcodes); + efree(formatargs); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP"); + RETURN_FALSE; +#endif case 'c': case 'C': case 's': @@ -283,6 +301,15 @@ PHP_FUNCTION(pack) INC_OUTPUTPOS(arg,4) /* 32 bit per arg */ break; +#if SIZEOF_LONG > 4 + case 'q': + case 'Q': + case 'J': + case 'P': + INC_OUTPUTPOS(arg,8) /* 32 bit per arg */ + break; +#endif + case 'f': INC_OUTPUTPOS(arg,sizeof(float)) break; @@ -437,6 +464,27 @@ PHP_FUNCTION(pack) break; } +#if SIZEOF_LONG > 4 + case 'q': + case 'Q': + case 'J': + case 'P': { + int *map = machine_endian_longlong_map; + + if (code == 'J') { + map = big_endian_longlong_map; + } else if (code == 'P') { + map = little_endian_longlong_map; + } + + while (arg-- > 0) { + php_pack(argv[currentarg++], 8, map, &output[outputpos]); + outputpos += 8; + } + break; + } +#endif + case 'f': { float v; @@ -522,7 +570,7 @@ static long php_unpack(char *data, int size, int issigned, int *map) * chars1, chars2, and ints. * Numeric pack types will return numbers, a and A will return strings, * f and d will return doubles. - * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @. + * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, q, Q, J, P, f, d, x, X, @. */ /* {{{ proto array unpack(string format, string input) Unpack binary string into named array elements according to format argument */ @@ -637,6 +685,20 @@ PHP_FUNCTION(unpack) size = 4; break; + /* Use 8 bytes of input */ + case 'q': + case 'Q': + case 'J': + case 'P': +#if SIZEOF_LONG > 4 + size = 8; + break; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP"); + zval_dtor(return_value); + RETURN_FALSE; +#endif + /* Use sizeof(float) bytes of input */ case 'f': size = sizeof(float); @@ -860,6 +922,38 @@ PHP_FUNCTION(unpack) break; } +#if SIZEOF_LONG > 4 + case 'q': + case 'Q': + case 'J': + case 'P': { + int issigned = 0; + int *map = machine_endian_longlong_map; + long v = 0; + + if (type == 'q' || type == 'Q') { + issigned = input[inputpos + (machine_little_endian ? 7 : 0)] & 0x80; + } else if (type == 'J') { + issigned = input[inputpos] & 0x80; + map = big_endian_longlong_map; + } else if (type == 'P') { + issigned = input[inputpos + 7] & 0x80; + map = little_endian_longlong_map; + } + + v = php_unpack(&input[inputpos], 8, issigned, map); + + if (type == 'q') { + v = (signed long int) v; + } else { + v = (unsigned long int) v; + } + + add_assoc_long(return_value, n, v); + break; + } +#endif + case 'f': { float v; @@ -961,6 +1055,33 @@ PHP_MINIT_FUNCTION(pack) little_endian_long_map[1] = 1; little_endian_long_map[2] = 2; little_endian_long_map[3] = 3; + +#if SIZEOF_LONG > 4 + machine_endian_longlong_map[0] = 0; + machine_endian_longlong_map[1] = 1; + machine_endian_longlong_map[2] = 2; + machine_endian_longlong_map[3] = 3; + machine_endian_longlong_map[4] = 4; + machine_endian_longlong_map[5] = 5; + machine_endian_longlong_map[6] = 6; + machine_endian_longlong_map[7] = 7; + big_endian_longlong_map[0] = 7; + big_endian_longlong_map[1] = 6; + big_endian_longlong_map[2] = 5; + big_endian_longlong_map[3] = 4; + big_endian_longlong_map[4] = 3; + big_endian_longlong_map[5] = 2; + big_endian_longlong_map[6] = 1; + big_endian_longlong_map[7] = 0; + little_endian_longlong_map[0] = 0; + little_endian_longlong_map[1] = 1; + little_endian_longlong_map[2] = 2; + little_endian_longlong_map[3] = 3; + little_endian_longlong_map[4] = 4; + little_endian_longlong_map[5] = 5; + little_endian_longlong_map[6] = 6; + little_endian_longlong_map[7] = 7; +#endif } else { zval val; @@ -993,6 +1114,33 @@ PHP_MINIT_FUNCTION(pack) little_endian_long_map[1] = size - 2; little_endian_long_map[2] = size - 3; little_endian_long_map[3] = size - 4; + +#if SIZEOF_LONG > 4 + machine_endian_longlong_map[0] = size - 8; + machine_endian_longlong_map[1] = size - 7; + machine_endian_longlong_map[2] = size - 6; + machine_endian_longlong_map[3] = size - 5; + machine_endian_longlong_map[0] = size - 4; + machine_endian_longlong_map[1] = size - 3; + machine_endian_longlong_map[2] = size - 2; + machine_endian_longlong_map[3] = size - 1; + big_endian_longlong_map[0] = size - 8; + big_endian_longlong_map[1] = size - 7; + big_endian_longlong_map[2] = size - 6; + big_endian_longlong_map[3] = size - 5; + big_endian_longlong_map[0] = size - 4; + big_endian_longlong_map[1] = size - 3; + big_endian_longlong_map[2] = size - 2; + big_endian_longlong_map[3] = size - 1; + little_endian_longlong_map[0] = size - 1; + little_endian_longlong_map[1] = size - 2; + little_endian_longlong_map[2] = size - 3; + little_endian_longlong_map[3] = size - 4; + little_endian_longlong_map[0] = size - 5; + little_endian_longlong_map[1] = size - 6; + little_endian_longlong_map[2] = size - 7; + little_endian_longlong_map[3] = size - 8; +#endif } return SUCCESS; diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt index 3a9f9c31a..a00ebf50b 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/streams/proc_open_bug51800.phpt b/ext/standard/tests/streams/proc_open_bug51800.phpt new file mode 100644 index 000000000..53cafd855 --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug51800.phpt @@ -0,0 +1,95 @@ +--TEST-- +Bug #51800 proc_open on Windows hangs forever +--SKIPIF-- +<?php + echo 'skip expected to fail or take too long'; + if (getenv("SKIP_SLOW_TESTS")) { + die("skip slow test"); + } +?> +--XFAIL-- +pipes have to be read/written simultaneously +--FILE-- +<?php +/* This is the wrong way to do it. The parent will block till it has read all the STDIN. +The smaller the pipe buffer is, the longer it will take. It might even pass at the end, +after taking inappropriately long. Pipes have to be read simultaneously in smaller chunks, +so then the pipe buffer is emptied more often and the child has chance to continue its +write. The behaviour might look some better if write/read in a separate thread, however +this is much more resource greedy and complexer to integrate into the user script. */ + +$callee = dirname(__FILE__) . "/process_proc_open_bug51800.php"; +$php = PHP_BINARY; +$cmd = "$php $callee"; + +$status; +$stdout = ""; +$stderr = ""; +$pipes = array(); + +$descriptors = array( + 0 => array("pipe", "rb"), // stdin + 1 => array("pipe", "wb"), // stdout + 2 => array("pipe", "wb") // stderr + ); + +/* create the proc file */ +$r = file_put_contents($callee, '<?php + +$how_much = 10000; + +$data0 = str_repeat("a", $how_much); +$data1 = str_repeat("b", $how_much); +fwrite(STDOUT, $data0); +fwrite(STDERR, $data1); + +exit(0); +'); + +if (!$r) { + die("couldn't create helper script '$callee'"); +} + +$process = proc_open($cmd, $descriptors, $pipes); + +if (is_resource($process)) +{ + fclose($pipes[0]); + + while (!feof($pipes[1])) + $stdout .= fread($pipes[1], 1024); + fclose($pipes[1]); + + while (!feof($pipes[2])) + $stderr .= fread($pipes[2], 1024); + fclose($pipes[2]); + + $status = proc_close($process); +} + +var_dump(array( + "status" => $status, + "stdout" => $stdout, + "stderr" => $stderr, +), strlen($stdout), strlen($stderr)); + +?> +===DONE=== +--CLEAN-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800.php"; +unlink($callee); +?> +--EXPECTF-- +array(3) { + ["status"]=> + int(0) + ["stdout"]=> + string(10000) "a%s" + ["stderr"]=> + string(10000) "b%s" +} +int(10000) +int(10000) +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug51800_right.phpt b/ext/standard/tests/streams/proc_open_bug51800_right.phpt new file mode 100644 index 000000000..b14fed2e5 --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug51800_right.phpt @@ -0,0 +1,78 @@ +--TEST-- +Bug #51800 proc_open on Windows hangs forever, the right way to do it +--FILE-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right.php"; +$php = PHP_BINARY; +$cmd = "$php $callee"; + +$status; +$stdout = ""; +$stderr = ""; +$pipes = array(); + +$descriptors = array( + 0 => array("pipe", "rb"), // stdin + 1 => array("pipe", "wb"), // stdout + 2 => array("pipe", "wb") // stderr + ); + +/* create the proc file */ +$r = file_put_contents($callee, '<?php + +$how_much = 10000; + +$data0 = str_repeat("a", $how_much); +$data1 = str_repeat("b", $how_much); +fwrite(STDOUT, $data0); +fwrite(STDERR, $data1); + +exit(0); +'); + +if (!$r) { + die("couldn't create helper script '$callee'"); +} + +$process = proc_open($cmd, $descriptors, $pipes); + +if (is_resource($process)) +{ + fclose($pipes[0]); + + while (!feof($pipes[1]) || !feof($pipes[2])) { + $stdout .= fread($pipes[1], 1024); + $stderr .= fread($pipes[2], 1024); + } + fclose($pipes[1]); + fclose($pipes[2]); + + $status = proc_close($process); +} + +var_dump(array( + "status" => $status, + "stdout" => $stdout, + "stderr" => $stderr, +), strlen($stdout), strlen($stderr)); + +?> +===DONE=== +--CLEAN-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right.php"; +unlink($callee); +?> +--EXPECTF-- +array(3) { + ["status"]=> + int(0) + ["stdout"]=> + string(10000) "a%s" + ["stderr"]=> + string(10000) "b%s" +} +int(10000) +int(10000) +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug51800_right2.phpt b/ext/standard/tests/streams/proc_open_bug51800_right2.phpt new file mode 100644 index 000000000..1e742745c --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug51800_right2.phpt @@ -0,0 +1,84 @@ +--TEST-- +Bug #51800 proc_open on Windows hangs forever, the right way to do it with more data +--FILE-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right2.php"; +$php = PHP_BINARY; +$cmd = "$php $callee"; + +$status; +$stdout = ""; +$stderr = ""; +$pipes = array(); + +$descriptors = array( + 0 => array("pipe", "rb"), // stdin + 1 => array("pipe", "wb"), // stdout + 2 => array("pipe", "wb") // stderr + ); + +/* create the proc file */ +$r = file_put_contents($callee, '<?php +$how_much = 1000000; + +$data0 = str_repeat("a", $how_much); +$data1 = str_repeat("b", $how_much); +$i0 = $i1 = 0; +$step = 1024; + +while ($i0 < strlen($data0) && $i1 < strlen($data1)) { + fwrite(STDOUT, substr($data0, $i0, $step)); + fwrite(STDERR, substr($data1, $i1, $step)); + $i0 += $step; + $i1 += $step; +} + +exit(0); +'); + +if (!$r) { + die("couldn't create helper script '$callee'"); +} + +$process = proc_open($cmd, $descriptors, $pipes); + +if (is_resource($process)) +{ + fclose($pipes[0]); + + while (!feof($pipes[1]) || !feof($pipes[2])) { + $stdout .= fread($pipes[1], 1024); + $stderr .= fread($pipes[2], 1024); + } + fclose($pipes[1]); + fclose($pipes[2]); + + $status = proc_close($process); +} + +var_dump(array( + "status" => $status, + "stdout" => $stdout, + "stderr" => $stderr, +), strlen($stdout), strlen($stderr)); + +?> +===DONE=== +--CLEAN-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right2.php"; +unlink($callee); +?> +--EXPECTF-- +array(3) { + ["status"]=> + int(0) + ["stdout"]=> + string(1000000) "a%s" + ["stderr"]=> + string(1000000) "b%s" +} +int(1000000) +int(1000000) +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug60120.phpt b/ext/standard/tests/streams/proc_open_bug60120.phpt new file mode 100644 index 000000000..8768257a2 --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug60120.phpt @@ -0,0 +1,71 @@ +--TEST-- +Bug #60120 proc_open hangs with stdin/out with 2048+ bytes +--FILE-- +<?php +error_reporting(E_ALL); + +if (substr(PHP_OS, 0, 3) == 'WIN') { + $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; +} else { + $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\''; +} +$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); +$stdin = str_repeat('*', 1024 * 16) . '!'; +$stdin = str_repeat('*', 2049 ); + +$options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false)); +$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); + +foreach ($pipes as $pipe) { + stream_set_blocking($pipe, false); +} +$writePipes = array($pipes[0]); +$stdinLen = strlen($stdin); +$stdinOffset = 0; + +unset($pipes[0]); + +while ($pipes || $writePipes) { + $r = $pipes; + $w = $writePipes; + $e = null; + $n = stream_select($r, $w, $e, 60); + + if (false === $n) { + break; + } elseif ($n === 0) { + proc_terminate($process); + + } + if ($w) { + $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192); + if (false !== $written) { + $stdinOffset += $written; + } + if ($stdinOffset >= $stdinLen) { + fclose($writePipes[0]); + $writePipes = null; + } + } + + foreach ($r as $pipe) { + $type = array_search($pipe, $pipes); + $data = fread($pipe, 8192); + var_dump($data); + if (false === $data || feof($pipe)) { + fclose($pipe); + unset($pipes[$type]); + } + } +} + + +?> +===DONE=== +--EXPECTF-- +string(2049) "%s" +string(2049) "%s" +string(0) "" +string(0) "" +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug64438.phpt b/ext/standard/tests/streams/proc_open_bug64438.phpt new file mode 100644 index 000000000..b3857d09d --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug64438.phpt @@ -0,0 +1,70 @@ +--TEST-- +Bug #64438 proc_open hangs with stdin/out with 4097+ bytes +--FILE-- +<?php + +error_reporting(E_ALL); + +if (substr(PHP_OS, 0, 3) == 'WIN') { + $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; +} else { + $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\''; +} +$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); +$stdin = str_repeat('*', 4097); + +$options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false)); +$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); + +foreach ($pipes as $pipe) { + stream_set_blocking($pipe, false); +} +$writePipes = array($pipes[0]); +$stdinLen = strlen($stdin); +$stdinOffset = 0; + +unset($pipes[0]); + +while ($pipes || $writePipes) { + $r = $pipes; + $w = $writePipes; + $e = null; + $n = stream_select($r, $w, $e, 60); + + if (false === $n) { + break; + } elseif ($n === 0) { + proc_terminate($process); + + } + if ($w) { + $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192); + if (false !== $written) { + $stdinOffset += $written; + } + if ($stdinOffset >= $stdinLen) { + fclose($writePipes[0]); + $writePipes = null; + } + } + + foreach ($r as $pipe) { + $type = array_search($pipe, $pipes); + $data = fread($pipe, 8192); + var_dump($data); + if (false === $data || feof($pipe)) { + fclose($pipe); + unset($pipes[$type]); + } + } +} + +?> +===DONE=== +--EXPECTF-- +string(4097) "%s" +string(4097) "%s" +string(0) "" +string(0) "" +===DONE=== + diff --git a/ext/standard/tests/strings/pack64.phpt b/ext/standard/tests/strings/pack64.phpt new file mode 100644 index 000000000..9bc24928f --- /dev/null +++ b/ext/standard/tests/strings/pack64.phpt @@ -0,0 +1,115 @@ +--TEST-- +64bit pack()/unpack() tests +--SKIPIF-- +<?php +if (PHP_INT_SIZE < 8) { + die("skip 64bit test only"); +} +?> +--FILE-- +<?php +print_r(unpack("Q", pack("Q", 0xfffffffffffe))); +print_r(unpack("Q", pack("Q", 0))); +print_r(unpack("Q", pack("Q", 0x8000000000000002))); +print_r(unpack("Q", pack("Q", -1))); +print_r(unpack("Q", pack("Q", 0x8000000000000000))); + +print_r(unpack("J", pack("J", 0xfffffffffffe))); +print_r(unpack("J", pack("J", 0))); +print_r(unpack("J", pack("J", 0x8000000000000002))); +print_r(unpack("J", pack("J", -1))); +print_r(unpack("J", pack("J", 0x8000000000000000))); + +print_r(unpack("P", pack("P", 0xfffffffffffe))); +print_r(unpack("P", pack("P", 0))); +print_r(unpack("P", pack("P", 0x8000000000000002))); +print_r(unpack("P", pack("P", -1))); +print_r(unpack("P", pack("P", 0x8000000000000000))); + +print_r(unpack("q", pack("q", 0xfffffffffffe))); +print_r(unpack("q", pack("q", 0))); +print_r(unpack("q", pack("q", 0x8000000000000002))); +print_r(unpack("q", pack("q", -1))); +print_r(unpack("q", pack("q", 0x8000000000000000))); +?> +--EXPECTF-- +Array +( + [1] => 281474976710654 +) +Array +( + [1] => 0 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => -1 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => 281474976710654 +) +Array +( + [1] => 0 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => -1 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => 281474976710654 +) +Array +( + [1] => 0 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => -1 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => 281474976710654 +) +Array +( + [1] => 0 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => -1 +) +Array +( + [1] => -9223372036854775808 +) diff --git a/ext/standard/tests/strings/pack64_32.phpt b/ext/standard/tests/strings/pack64_32.phpt new file mode 100644 index 000000000..f52de63ca --- /dev/null +++ b/ext/standard/tests/strings/pack64_32.phpt @@ -0,0 +1,44 @@ +--TEST-- +64bit pack()/unpack() tests +--SKIPIF-- +<?php +if (PHP_INT_SIZE > 4) { + die("skip 32bit test only"); +} +?> +--FILE-- +<?php +var_dump(pack("Q", 0)); +var_dump(pack("J", 0)); +var_dump(pack("P", 0)); +var_dump(pack("q", 0)); + +var_dump(unpack("Q", '')); +var_dump(unpack("J", '')); +var_dump(unpack("P", '')); +var_dump(unpack("q", '')); +?> +--EXPECTF-- +Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt index 038ba58c5..5ebdfe8d5 100644 --- a/ext/standard/tests/strings/setlocale_variation2.phpt +++ b/ext/standard/tests/strings/setlocale_variation2.phpt @@ -18,8 +18,11 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { /* setlocale() to set all available locales in the system and check the success count */ echo "*** Testing setlocale() : usage variations ***\n"; -function good_locale($locale) { - return $locale !== 'tt_RU@iqtelif.UTF-8'; +function good_locale($locale) { + /** + * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/971416 + **/ + return $locale !== 'tt_RU@iqtelif.UTF-8' && $locale !== 'no_NO.ISO-8859-1'; } /* Prototype : array list_system_locales( void ) diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt index e0e541103..e172061ec 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 a6f4f7a25..0708691fe 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 1fc946e5b..5b2cb98f8 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 510432619..79af6b8b6 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 fe1b2fe11..06c72e483 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/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c index b766a5495..f184cf49e 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; |