diff options
Diffstat (limited to 'ext')
606 files changed, 7879 insertions, 3031 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index 65b06d79f..abe84fc31 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -518,7 +518,7 @@ static PHP_FUNCTION(bzcompress) efree(dest); RETURN_LONG(error); } else { - /* Copy the buffer, we have perhaps allocate alot more than we need, + /* Copy the buffer, we have perhaps allocate a lot more than we need, so we erealloc() the buffer to the proper size */ dest = erealloc(dest, dest_len + 1); dest[dest_len] = 0; diff --git a/ext/bz2/tests/bug51997.phpt b/ext/bz2/tests/bug51997.phpt index fea539894..c53deacc5 100644 --- a/ext/bz2/tests/bug51997.phpt +++ b/ext/bz2/tests/bug51997.phpt @@ -7,7 +7,7 @@ Bug #51997 (SEEK_CUR with 0 value, returns a warning) error_reporting(E_ALL); -$filename = "testfile.bz2"; +$filename = "bug51997.bz2"; $str = "This is a test string.\n"; $bz = bzopen($filename, "w"); bzwrite($bz, $str); diff --git a/ext/bz2/tests/with_files.phpt b/ext/bz2/tests/with_files.phpt index 569144593..3763398a1 100644 --- a/ext/bz2/tests/with_files.phpt +++ b/ext/bz2/tests/with_files.phpt @@ -7,7 +7,7 @@ BZ2 with files error_reporting(E_ALL); -$filename = "testfile.bz2"; +$filename = "with_files.bz2"; $str = "This is a test string.\n"; $bz = bzopen($filename, "w"); bzwrite($bz, $str); diff --git a/ext/calendar/jewish.c b/ext/calendar/jewish.c index f4dc7c35a..fcc0e5c0b 100644 --- a/ext/calendar/jewish.c +++ b/ext/calendar/jewish.c @@ -272,6 +272,7 @@ #define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7)) #define JEWISH_SDN_OFFSET 347997 +#define JEWISH_SDN_MAX 324542846L /* 12/13/887605, greater value raises interger overflow */ #define NEW_MOON_OF_CREATION 31524 #define SUNDAY 0 @@ -519,7 +520,7 @@ void SdnToJewish( int tishri1After; int yearLength; - if (sdn <= JEWISH_SDN_OFFSET) { + if (sdn <= JEWISH_SDN_OFFSET || sdn > JEWISH_SDN_MAX) { *pYear = 0; *pMonth = 0; *pDay = 0; diff --git a/ext/calendar/tests/jdtojewish64.phpt b/ext/calendar/tests/jdtojewish64.phpt new file mode 100644 index 000000000..9f01109a7 --- /dev/null +++ b/ext/calendar/tests/jdtojewish64.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #64895: Integer overflow in SndToJewish +--SKIPIF-- +<?php +include 'skipif.inc'; +if (PHP_INT_SIZE == 4) { + die("skip this test is for 64bit platform only"); +} +?> +--FILE-- +<?php +$a = array(38245310, 324542846, 324542847, 9223372036854743639); + +foreach ($a as $x) var_dump(jdtojewish($x)); +--EXPECTF-- +string(11) "2/22/103759" +string(12) "12/13/887605" +string(5) "0/0/0" +string(5) "0/0/0" diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c index 853b7df4c..556f356b9 100644 --- a/ext/com_dotnet/com_variant.c +++ b/ext/com_dotnet/com_variant.c @@ -102,8 +102,9 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep { OLECHAR *olestring; php_com_dotnet_object *obj; + zend_uchar ztype = (z == NULL ? IS_NULL : Z_TYPE_P(z)); - switch (Z_TYPE_P(z)) { + switch (ztype) { case IS_NULL: V_VT(v) = VT_NULL; break; @@ -429,7 +430,7 @@ PHP_FUNCTION(com_variant_create_instance) /* If already an array and VT_ARRAY is passed then: - if only VT_ARRAY passed then do not perform a conversion - if VT_ARRAY plus other type passed then perform conversion - but will probably fail (origional behavior) + but will probably fail (original behavior) */ if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) { long orig_vt = vt; diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 531f15ba1..d122051ad 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1068,7 +1068,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double { php_curl *ch = (php_curl *) clientp; php_curl_progress *t = ch->handlers->progress; - int length = -1; size_t rval = 0; #if PHP_CURL_DEBUG @@ -1118,7 +1117,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double ch->in_callback = 0; if (error == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION"); - length = -1; } else if (retval_ptr) { if (Z_TYPE_P(retval_ptr) != IS_LONG) { convert_to_long_ex(&retval_ptr); @@ -1373,9 +1371,9 @@ static void curl_free_post(void **post) /* {{{ curl_free_slist */ -static void curl_free_slist(void **slist) +static void curl_free_slist(void *slist) { - curl_slist_free_all((struct curl_slist *) *slist); + curl_slist_free_all(*((struct curl_slist **) slist)); } /* }}} */ @@ -1443,8 +1441,10 @@ static void alloc_curl_handle(php_curl **ch) (*ch)->handlers->read->stream = NULL; zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0); - zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0); zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0); + + (*ch)->to_free->slist = emalloc(sizeof(HashTable)); + zend_hash_init((*ch)->to_free->slist, 4, NULL, curl_free_slist, 0); } /* }}} */ @@ -1675,6 +1675,7 @@ PHP_FUNCTION(curl_copy_handle) curl_easy_setopt(dupch->cp, CURLOPT_WRITEHEADER, (void *) dupch); curl_easy_setopt(dupch->cp, CURLOPT_PROGRESSDATA, (void *) dupch); + efree(dupch->to_free->slist); efree(dupch->to_free); dupch->to_free = ch->to_free; @@ -2184,7 +2185,7 @@ string_copy: return 1; } } - zend_llist_add_element(&ch->to_free->slist, &slist); + zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL); error = curl_easy_setopt(ch->cp, option, slist); @@ -2680,8 +2681,9 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC) /* cURL destructors should be invoked only by last curl handle */ if (Z_REFCOUNT_P(ch->clone) <= 1) { zend_llist_clean(&ch->to_free->str); - zend_llist_clean(&ch->to_free->slist); zend_llist_clean(&ch->to_free->post); + zend_hash_destroy(ch->to_free->slist); + efree(ch->to_free->slist); efree(ch->to_free); FREE_ZVAL(ch->clone); } else { diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index 945f0a430..911d87a6b 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -126,7 +126,7 @@ struct _php_curl_send_headers { struct _php_curl_free { zend_llist str; zend_llist post; - zend_llist slist; + HashTable *slist; }; typedef struct { diff --git a/ext/curl/tests/bug65458.phpt b/ext/curl/tests/bug65458.phpt new file mode 100644 index 000000000..99288f24b --- /dev/null +++ b/ext/curl/tests/bug65458.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #65458 (curl memory leak) +--SKIPIF-- +<?php +if (!extension_loaded('curl')) exit("skip curl extension not loaded"); +?> +--FILE-- +<?php +$ch = curl_init(); +$init = memory_get_usage(); +for ($i = 0; $i < 10000; $i++) { + curl_setopt($ch, CURLOPT_HTTPHEADER, [ "SOAPAction: getItems" ]); +} + +$preclose = memory_get_usage(); +curl_close($ch); + +// This is a slightly tricky heuristic, but basically, we want to ensure +// $preclose - $init has a delta in the order of bytes, not megabytes. Given +// the number of iterations in the loop, if we're wasting memory here, we +// should have megs and megs of extra allocations. +var_dump(($preclose - $init) < 10000); +?> +--EXPECT-- +bool(true) diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 0421e2172..f85a99dc6 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sun Sep 30 20:14:42 2012 */ +/* Generated by re2c 0.13.5 on Sun Aug 25 14:46:08 2013 */ /* +----------------------------------------------------------------------+ | PHP Version 5 | @@ -650,7 +650,8 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr) char *begin = *ptr, *end; const timelib_relunit *tp, *value = NULL; - while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') { + while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' && + **ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) { ++*ptr; } end = *ptr; @@ -24937,7 +24938,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim TIMELIB_CHECK_NUMBER; sec = timelib_get_nr_ex((char **) &ptr, 2, &length); if (sec == TIMELIB_UNSET || length != 2) { - add_pbf_error(s, "A two second minute could not be found", string, begin); + add_pbf_error(s, "A two digit second could not be found", string, begin); } else { s->time->s = sec; } @@ -25025,7 +25026,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim break; case '\\': /* escaped char */ - *fptr++; + fptr++; if (*ptr == *fptr) { ++ptr; } else { diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 8e1972d99..df33508f5 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -649,7 +649,8 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr) char *begin = *ptr, *end; const timelib_relunit *tp, *value = NULL; - while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') { + while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' && + **ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) { ++*ptr; } end = *ptr; @@ -2042,7 +2043,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim TIMELIB_CHECK_NUMBER; sec = timelib_get_nr_ex((char **) &ptr, 2, &length); if (sec == TIMELIB_UNSET || length != 2) { - add_pbf_error(s, "A two second minute could not be found", string, begin); + add_pbf_error(s, "A two digit second could not be found", string, begin); } else { s->time->s = sec; } @@ -2130,7 +2131,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim break; case '\\': /* escaped char */ - *fptr++; + fptr++; if (*ptr == *fptr) { ++ptr; } else { diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 2f9d8fe66..8142aab56 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -58,529 +58,529 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[579] = { { "America/Anguilla" , 0x002952 }, { "America/Antigua" , 0x0029A7 }, { "America/Araguaina" , 0x002A0D }, - { "America/Argentina/Buenos_Aires" , 0x002C67 }, - { "America/Argentina/Catamarca" , 0x002E15 }, - { "America/Argentina/ComodRivadavia" , 0x002FD6 }, - { "America/Argentina/Cordoba" , 0x00317C }, - { "America/Argentina/Jujuy" , 0x003351 }, - { "America/Argentina/La_Rioja" , 0x003505 }, - { "America/Argentina/Mendoza" , 0x0036BD }, - { "America/Argentina/Rio_Gallegos" , 0x00387D }, - { "America/Argentina/Salta" , 0x003A32 }, - { "America/Argentina/San_Juan" , 0x003BDE }, - { "America/Argentina/San_Luis" , 0x003D96 }, - { "America/Argentina/Tucuman" , 0x003F5C }, - { "America/Argentina/Ushuaia" , 0x004118 }, - { "America/Aruba" , 0x0042D3 }, - { "America/Asuncion" , 0x004339 }, - { "America/Atikokan" , 0x00461E }, - { "America/Atka" , 0x0046F4 }, - { "America/Bahia" , 0x004A5A }, - { "America/Bahia_Banderas" , 0x004BED }, - { "America/Barbados" , 0x004E66 }, - { "America/Belem" , 0x004F00 }, - { "America/Belize" , 0x004FFB }, - { "America/Blanc-Sablon" , 0x005177 }, - { "America/Boa_Vista" , 0x00522B }, - { "America/Bogota" , 0x005334 }, - { "America/Boise" , 0x0053A0 }, - { "America/Buenos_Aires" , 0x005737 }, - { "America/Cambridge_Bay" , 0x0058D0 }, - { "America/Campo_Grande" , 0x005BF8 }, - { "America/Cancun" , 0x005EE7 }, - { "America/Caracas" , 0x006129 }, - { "America/Catamarca" , 0x006190 }, - { "America/Cayenne" , 0x006336 }, - { "America/Cayman" , 0x006398 }, - { "America/Chicago" , 0x0063ED }, - { "America/Chihuahua" , 0x006904 }, - { "America/Coral_Harbour" , 0x006B6F }, - { "America/Cordoba" , 0x006C01 }, - { "America/Costa_Rica" , 0x006DA7 }, - { "America/Creston" , 0x006E31 }, - { "America/Cuiaba" , 0x006EBD }, - { "America/Curacao" , 0x00719B }, - { "America/Danmarkshavn" , 0x007201 }, - { "America/Dawson" , 0x007345 }, - { "America/Dawson_Creek" , 0x007662 }, - { "America/Denver" , 0x00783C }, - { "America/Detroit" , 0x007BC2 }, - { "America/Dominica" , 0x007F21 }, - { "America/Edmonton" , 0x007F76 }, - { "America/Eirunepe" , 0x00832E }, - { "America/El_Salvador" , 0x008441 }, - { "America/Ensenada" , 0x0084B6 }, - { "America/Fort_Wayne" , 0x00895D }, - { "America/Fortaleza" , 0x00881F }, - { "America/Glace_Bay" , 0x008BC7 }, - { "America/Godthab" , 0x008F3E }, - { "America/Goose_Bay" , 0x009202 }, - { "America/Grand_Turk" , 0x0096BF }, - { "America/Grenada" , 0x00996E }, - { "America/Guadeloupe" , 0x0099C3 }, - { "America/Guatemala" , 0x009A18 }, - { "America/Guayaquil" , 0x009AA1 }, - { "America/Guyana" , 0x009AFE }, - { "America/Halifax" , 0x009B7F }, - { "America/Havana" , 0x00A095 }, - { "America/Hermosillo" , 0x00A408 }, - { "America/Indiana/Indianapolis" , 0x00A4E6 }, - { "America/Indiana/Knox" , 0x00A777 }, - { "America/Indiana/Marengo" , 0x00AB0E }, - { "America/Indiana/Petersburg" , 0x00ADB4 }, - { "America/Indiana/Tell_City" , 0x00B301 }, - { "America/Indiana/Vevay" , 0x00B59A }, - { "America/Indiana/Vincennes" , 0x00B7D5 }, - { "America/Indiana/Winamac" , 0x00BA89 }, - { "America/Indianapolis" , 0x00B097 }, - { "America/Inuvik" , 0x00BD42 }, - { "America/Iqaluit" , 0x00C039 }, - { "America/Jamaica" , 0x00C35B }, - { "America/Jujuy" , 0x00C420 }, - { "America/Juneau" , 0x00C5CA }, - { "America/Kentucky/Louisville" , 0x00C948 }, - { "America/Kentucky/Monticello" , 0x00CD66 }, - { "America/Knox_IN" , 0x00D0EB }, - { "America/Kralendijk" , 0x00D45C }, - { "America/La_Paz" , 0x00D4C2 }, - { "America/Lima" , 0x00D529 }, - { "America/Los_Angeles" , 0x00D5D1 }, - { "America/Louisville" , 0x00D9E2 }, - { "America/Lower_Princes" , 0x00DDD7 }, - { "America/Maceio" , 0x00DE3D }, - { "America/Managua" , 0x00DF77 }, - { "America/Manaus" , 0x00E02A }, - { "America/Marigot" , 0x00E12C }, - { "America/Martinique" , 0x00E181 }, - { "America/Matamoros" , 0x00E1ED }, - { "America/Mazatlan" , 0x00E446 }, - { "America/Mendoza" , 0x00E6B3 }, - { "America/Menominee" , 0x00E867 }, - { "America/Merida" , 0x00EBE8 }, - { "America/Metlakatla" , 0x00EE23 }, - { "America/Mexico_City" , 0x00EF5D }, - { "America/Miquelon" , 0x00F1D8 }, - { "America/Moncton" , 0x00F44A }, - { "America/Monterrey" , 0x00F8E1 }, - { "America/Montevideo" , 0x00FB44 }, - { "America/Montreal" , 0x00FE56 }, - { "America/Montserrat" , 0x01036C }, - { "America/Nassau" , 0x0103C1 }, - { "America/New_York" , 0x010706 }, - { "America/Nipigon" , 0x010C11 }, - { "America/Nome" , 0x010F62 }, - { "America/Noronha" , 0x0112E0 }, - { "America/North_Dakota/Beulah" , 0x011410 }, - { "America/North_Dakota/Center" , 0x0117A4 }, - { "America/North_Dakota/New_Salem" , 0x011B38 }, - { "America/Ojinaga" , 0x011EE1 }, - { "America/Panama" , 0x012142 }, - { "America/Pangnirtung" , 0x012197 }, - { "America/Paramaribo" , 0x0124CD }, - { "America/Phoenix" , 0x01255F }, - { "America/Port-au-Prince" , 0x01260D }, - { "America/Port_of_Spain" , 0x01292C }, - { "America/Porto_Acre" , 0x01282D }, - { "America/Porto_Velho" , 0x012981 }, - { "America/Puerto_Rico" , 0x012A77 }, - { "America/Rainy_River" , 0x012AE2 }, - { "America/Rankin_Inlet" , 0x012E1A }, - { "America/Recife" , 0x013100 }, - { "America/Regina" , 0x01322A }, - { "America/Resolute" , 0x0133E8 }, - { "America/Rio_Branco" , 0x0136D9 }, - { "America/Rosario" , 0x0137DC }, - { "America/Santa_Isabel" , 0x013982 }, - { "America/Santarem" , 0x013D25 }, - { "America/Santiago" , 0x013E2A }, - { "America/Santo_Domingo" , 0x0141D3 }, - { "America/Sao_Paulo" , 0x014299 }, - { "America/Scoresbysund" , 0x0145A8 }, - { "America/Shiprock" , 0x014896 }, - { "America/Sitka" , 0x014C25 }, - { "America/St_Barthelemy" , 0x014FAD }, - { "America/St_Johns" , 0x015002 }, - { "America/St_Kitts" , 0x015555 }, - { "America/St_Lucia" , 0x0155AA }, - { "America/St_Thomas" , 0x0155FF }, - { "America/St_Vincent" , 0x015654 }, - { "America/Swift_Current" , 0x0156A9 }, - { "America/Tegucigalpa" , 0x0157CA }, - { "America/Thule" , 0x015849 }, - { "America/Thunder_Bay" , 0x015A90 }, - { "America/Tijuana" , 0x015DD9 }, - { "America/Toronto" , 0x016172 }, - { "America/Tortola" , 0x016689 }, - { "America/Vancouver" , 0x0166DE }, - { "America/Virgin" , 0x016B1B }, - { "America/Whitehorse" , 0x016B70 }, - { "America/Winnipeg" , 0x016E8D }, - { "America/Yakutat" , 0x0172CD }, - { "America/Yellowknife" , 0x017638 }, - { "Antarctica/Casey" , 0x017948 }, - { "Antarctica/Davis" , 0x0179E5 }, - { "Antarctica/DumontDUrville" , 0x017A86 }, - { "Antarctica/Macquarie" , 0x017B18 }, - { "Antarctica/Mawson" , 0x017D5F }, - { "Antarctica/McMurdo" , 0x017DDB }, - { "Antarctica/Palmer" , 0x0180DD }, - { "Antarctica/Rothera" , 0x0183F9 }, - { "Antarctica/South_Pole" , 0x01846F }, - { "Antarctica/Syowa" , 0x018777 }, - { "Antarctica/Vostok" , 0x0187E5 }, - { "Arctic/Longyearbyen" , 0x018856 }, - { "Asia/Aden" , 0x018B88 }, - { "Asia/Almaty" , 0x018BDD }, - { "Asia/Amman" , 0x018D5C }, - { "Asia/Anadyr" , 0x019012 }, - { "Asia/Aqtau" , 0x0191F7 }, - { "Asia/Aqtobe" , 0x0193F6 }, - { "Asia/Ashgabat" , 0x0195AE }, - { "Asia/Ashkhabad" , 0x0196CB }, - { "Asia/Baghdad" , 0x0197E8 }, - { "Asia/Bahrain" , 0x01995D }, - { "Asia/Baku" , 0x0199C3 }, - { "Asia/Bangkok" , 0x019CAB }, - { "Asia/Beirut" , 0x019D00 }, - { "Asia/Bishkek" , 0x01A00D }, - { "Asia/Brunei" , 0x01A1B9 }, - { "Asia/Calcutta" , 0x01A21B }, - { "Asia/Choibalsan" , 0x01A294 }, - { "Asia/Chongqing" , 0x01A40D }, - { "Asia/Chungking" , 0x01A4FC }, - { "Asia/Colombo" , 0x01A5AB }, - { "Asia/Dacca" , 0x01A647 }, - { "Asia/Damascus" , 0x01A6ED }, - { "Asia/Dhaka" , 0x01AA3D }, - { "Asia/Dili" , 0x01AAE3 }, - { "Asia/Dubai" , 0x01AB6C }, - { "Asia/Dushanbe" , 0x01ABC1 }, - { "Asia/Gaza" , 0x01ACC4 }, - { "Asia/Harbin" , 0x01B017 }, - { "Asia/Hebron" , 0x01B0FE }, - { "Asia/Ho_Chi_Minh" , 0x01B45A }, - { "Asia/Hong_Kong" , 0x01B4D2 }, - { "Asia/Hovd" , 0x01B694 }, - { "Asia/Irkutsk" , 0x01B80C }, - { "Asia/Istanbul" , 0x01B9F2 }, - { "Asia/Jakarta" , 0x01BDDF }, - { "Asia/Jayapura" , 0x01BE89 }, - { "Asia/Jerusalem" , 0x01BF25 }, - { "Asia/Kabul" , 0x01C254 }, - { "Asia/Kamchatka" , 0x01C2A5 }, - { "Asia/Karachi" , 0x01C481 }, - { "Asia/Kashgar" , 0x01C536 }, - { "Asia/Kathmandu" , 0x01C607 }, - { "Asia/Katmandu" , 0x01C66D }, - { "Asia/Khandyga" , 0x01C6D3 }, - { "Asia/Kolkata" , 0x01C8F8 }, - { "Asia/Krasnoyarsk" , 0x01C971 }, - { "Asia/Kuala_Lumpur" , 0x01CB59 }, - { "Asia/Kuching" , 0x01CC16 }, - { "Asia/Kuwait" , 0x01CD04 }, - { "Asia/Macao" , 0x01CD59 }, - { "Asia/Macau" , 0x01CE94 }, - { "Asia/Magadan" , 0x01CFCF }, - { "Asia/Makassar" , 0x01D1B1 }, - { "Asia/Manila" , 0x01D275 }, - { "Asia/Muscat" , 0x01D2FA }, - { "Asia/Nicosia" , 0x01D34F }, - { "Asia/Novokuznetsk" , 0x01D637 }, - { "Asia/Novosibirsk" , 0x01D839 }, - { "Asia/Omsk" , 0x01DA24 }, - { "Asia/Oral" , 0x01DC0B }, - { "Asia/Phnom_Penh" , 0x01DDDB }, - { "Asia/Pontianak" , 0x01DE53 }, - { "Asia/Pyongyang" , 0x01DF14 }, - { "Asia/Qatar" , 0x01DF81 }, - { "Asia/Qyzylorda" , 0x01DFE7 }, - { "Asia/Rangoon" , 0x01E1BD }, - { "Asia/Riyadh" , 0x01E235 }, - { "Asia/Saigon" , 0x01E28A }, - { "Asia/Sakhalin" , 0x01E302 }, - { "Asia/Samarkand" , 0x01E4F9 }, - { "Asia/Seoul" , 0x01E62F }, - { "Asia/Shanghai" , 0x01E6D3 }, - { "Asia/Singapore" , 0x01E7B3 }, - { "Asia/Taipei" , 0x01E86A }, - { "Asia/Tashkent" , 0x01E982 }, - { "Asia/Tbilisi" , 0x01EAB3 }, - { "Asia/Tehran" , 0x01EC6D }, - { "Asia/Tel_Aviv" , 0x01EEDB }, - { "Asia/Thimbu" , 0x01F20A }, - { "Asia/Thimphu" , 0x01F270 }, - { "Asia/Tokyo" , 0x01F2D6 }, - { "Asia/Ujung_Pandang" , 0x01F35F }, - { "Asia/Ulaanbaatar" , 0x01F3DB }, - { "Asia/Ulan_Bator" , 0x01F536 }, - { "Asia/Urumqi" , 0x01F683 }, - { "Asia/Ust-Nera" , 0x01F74A }, - { "Asia/Vientiane" , 0x01F94F }, - { "Asia/Vladivostok" , 0x01F9C7 }, - { "Asia/Yakutsk" , 0x01FBB3 }, - { "Asia/Yekaterinburg" , 0x01FD98 }, - { "Asia/Yerevan" , 0x01FFA3 }, - { "Atlantic/Azores" , 0x0201A3 }, - { "Atlantic/Bermuda" , 0x0206A6 }, - { "Atlantic/Canary" , 0x020987 }, - { "Atlantic/Cape_Verde" , 0x020C5D }, - { "Atlantic/Faeroe" , 0x020CD6 }, - { "Atlantic/Faroe" , 0x020F7A }, - { "Atlantic/Jan_Mayen" , 0x02121E }, - { "Atlantic/Madeira" , 0x021550 }, - { "Atlantic/Reykjavik" , 0x021A59 }, - { "Atlantic/South_Georgia" , 0x021C12 }, - { "Atlantic/St_Helena" , 0x021E24 }, - { "Atlantic/Stanley" , 0x021C56 }, - { "Australia/ACT" , 0x021E79 }, - { "Australia/Adelaide" , 0x022196 }, - { "Australia/Brisbane" , 0x0224C2 }, - { "Australia/Broken_Hill" , 0x022589 }, - { "Australia/Canberra" , 0x0228C7 }, - { "Australia/Currie" , 0x022BE4 }, - { "Australia/Darwin" , 0x022F17 }, - { "Australia/Eucla" , 0x022F9D }, - { "Australia/Hobart" , 0x023072 }, - { "Australia/LHI" , 0x0233D0 }, - { "Australia/Lindeman" , 0x02366B }, - { "Australia/Lord_Howe" , 0x02374C }, - { "Australia/Melbourne" , 0x0239F7 }, - { "Australia/North" , 0x023D1C }, - { "Australia/NSW" , 0x023D90 }, - { "Australia/Perth" , 0x0240AD }, - { "Australia/Queensland" , 0x024185 }, - { "Australia/South" , 0x024231 }, - { "Australia/Sydney" , 0x02454E }, - { "Australia/Tasmania" , 0x02488B }, - { "Australia/Victoria" , 0x024BD0 }, - { "Australia/West" , 0x024EED }, - { "Australia/Yancowinna" , 0x024FA3 }, - { "Brazil/Acre" , 0x0252C5 }, - { "Brazil/DeNoronha" , 0x0253C4 }, - { "Brazil/East" , 0x0254E4 }, - { "Brazil/West" , 0x0257C1 }, - { "Canada/Atlantic" , 0x0258B9 }, - { "Canada/Central" , 0x025DA1 }, - { "Canada/East-Saskatchewan" , 0x0266AB }, - { "Canada/Eastern" , 0x0261BB }, - { "Canada/Mountain" , 0x026834 }, - { "Canada/Newfoundland" , 0x026BAA }, - { "Canada/Pacific" , 0x0270D5 }, - { "Canada/Saskatchewan" , 0x0274EE }, - { "Canada/Yukon" , 0x027677 }, - { "CET" , 0x02797A }, - { "Chile/Continental" , 0x027C83 }, - { "Chile/EasterIsland" , 0x02801E }, - { "CST6CDT" , 0x028360 }, - { "Cuba" , 0x0286B1 }, - { "EET" , 0x028A24 }, - { "Egypt" , 0x028CD7 }, - { "Eire" , 0x028F9A }, - { "EST" , 0x0294AB }, - { "EST5EDT" , 0x0294EF }, - { "Etc/GMT" , 0x029840 }, - { "Etc/GMT+0" , 0x02990C }, - { "Etc/GMT+1" , 0x029996 }, - { "Etc/GMT+10" , 0x029A23 }, - { "Etc/GMT+11" , 0x029AB1 }, - { "Etc/GMT+12" , 0x029B3F }, - { "Etc/GMT+2" , 0x029C5A }, - { "Etc/GMT+3" , 0x029CE6 }, - { "Etc/GMT+4" , 0x029D72 }, - { "Etc/GMT+5" , 0x029DFE }, - { "Etc/GMT+6" , 0x029E8A }, - { "Etc/GMT+7" , 0x029F16 }, - { "Etc/GMT+8" , 0x029FA2 }, - { "Etc/GMT+9" , 0x02A02E }, - { "Etc/GMT-0" , 0x0298C8 }, - { "Etc/GMT-1" , 0x029950 }, - { "Etc/GMT-10" , 0x0299DC }, - { "Etc/GMT-11" , 0x029A6A }, - { "Etc/GMT-12" , 0x029AF8 }, - { "Etc/GMT-13" , 0x029B86 }, - { "Etc/GMT-14" , 0x029BCD }, - { "Etc/GMT-2" , 0x029C14 }, - { "Etc/GMT-3" , 0x029CA0 }, - { "Etc/GMT-4" , 0x029D2C }, - { "Etc/GMT-5" , 0x029DB8 }, - { "Etc/GMT-6" , 0x029E44 }, - { "Etc/GMT-7" , 0x029ED0 }, - { "Etc/GMT-8" , 0x029F5C }, - { "Etc/GMT-9" , 0x029FE8 }, - { "Etc/GMT0" , 0x029884 }, - { "Etc/Greenwich" , 0x02A074 }, - { "Etc/UCT" , 0x02A0B8 }, - { "Etc/Universal" , 0x02A0FC }, - { "Etc/UTC" , 0x02A140 }, - { "Etc/Zulu" , 0x02A184 }, - { "Europe/Amsterdam" , 0x02A1C8 }, - { "Europe/Andorra" , 0x02A606 }, - { "Europe/Athens" , 0x02A882 }, - { "Europe/Belfast" , 0x02ABC5 }, - { "Europe/Belgrade" , 0x02B0FC }, - { "Europe/Berlin" , 0x02B3C5 }, - { "Europe/Bratislava" , 0x02B729 }, - { "Europe/Brussels" , 0x02BA5B }, - { "Europe/Bucharest" , 0x02BE92 }, - { "Europe/Budapest" , 0x02C1BC }, - { "Europe/Busingen" , 0x02C52F }, - { "Europe/Chisinau" , 0x02C7E6 }, - { "Europe/Copenhagen" , 0x02CB74 }, - { "Europe/Dublin" , 0x02CE7E }, - { "Europe/Gibraltar" , 0x02D38F }, - { "Europe/Guernsey" , 0x02D7E6 }, - { "Europe/Helsinki" , 0x02DD1D }, - { "Europe/Isle_of_Man" , 0x02DFD3 }, - { "Europe/Istanbul" , 0x02E50A }, - { "Europe/Jersey" , 0x02E8F7 }, - { "Europe/Kaliningrad" , 0x02EE2E }, - { "Europe/Kiev" , 0x02F094 }, - { "Europe/Lisbon" , 0x02F3AB }, - { "Europe/Ljubljana" , 0x02F8AF }, - { "Europe/London" , 0x02FB78 }, - { "Europe/Luxembourg" , 0x0300AF }, - { "Europe/Madrid" , 0x030505 }, - { "Europe/Malta" , 0x0308CB }, - { "Europe/Mariehamn" , 0x030C84 }, - { "Europe/Minsk" , 0x030F3A }, - { "Europe/Monaco" , 0x031148 }, - { "Europe/Moscow" , 0x031583 }, - { "Europe/Nicosia" , 0x0317D4 }, - { "Europe/Oslo" , 0x031ABC }, - { "Europe/Paris" , 0x031DEE }, - { "Europe/Podgorica" , 0x032234 }, - { "Europe/Prague" , 0x0324FD }, - { "Europe/Riga" , 0x03282F }, - { "Europe/Rome" , 0x032B74 }, - { "Europe/Samara" , 0x032F37 }, - { "Europe/San_Marino" , 0x03316A }, - { "Europe/Sarajevo" , 0x03352D }, - { "Europe/Simferopol" , 0x0337F6 }, - { "Europe/Skopje" , 0x033B21 }, - { "Europe/Sofia" , 0x033DEA }, - { "Europe/Stockholm" , 0x0340F2 }, - { "Europe/Tallinn" , 0x0343A1 }, - { "Europe/Tirane" , 0x0346DB }, - { "Europe/Tiraspol" , 0x0349E1 }, - { "Europe/Uzhgorod" , 0x034D6F }, - { "Europe/Vaduz" , 0x035086 }, - { "Europe/Vatican" , 0x035319 }, - { "Europe/Vienna" , 0x0356DC }, - { "Europe/Vilnius" , 0x035A09 }, - { "Europe/Volgograd" , 0x035D48 }, - { "Europe/Warsaw" , 0x035F48 }, - { "Europe/Zagreb" , 0x036329 }, - { "Europe/Zaporozhye" , 0x0365F2 }, - { "Europe/Zurich" , 0x036933 }, - { "Factory" , 0x036BE2 }, - { "GB" , 0x036C53 }, - { "GB-Eire" , 0x03718A }, - { "GMT" , 0x0376C1 }, - { "GMT+0" , 0x03778D }, - { "GMT-0" , 0x037749 }, - { "GMT0" , 0x037705 }, - { "Greenwich" , 0x0377D1 }, - { "Hongkong" , 0x037815 }, - { "HST" , 0x0379D7 }, - { "Iceland" , 0x037A1B }, - { "Indian/Antananarivo" , 0x037BD4 }, - { "Indian/Chagos" , 0x037C48 }, - { "Indian/Christmas" , 0x037CAA }, - { "Indian/Cocos" , 0x037CEE }, - { "Indian/Comoro" , 0x037D32 }, - { "Indian/Kerguelen" , 0x037D87 }, - { "Indian/Mahe" , 0x037DDC }, - { "Indian/Maldives" , 0x037E31 }, - { "Indian/Mauritius" , 0x037E86 }, - { "Indian/Mayotte" , 0x037EFC }, - { "Indian/Reunion" , 0x037F51 }, - { "Iran" , 0x037FA6 }, - { "Israel" , 0x038214 }, - { "Jamaica" , 0x038543 }, - { "Japan" , 0x038608 }, - { "Kwajalein" , 0x038691 }, - { "Libya" , 0x0386F4 }, - { "MET" , 0x0388ED }, - { "Mexico/BajaNorte" , 0x038BF6 }, - { "Mexico/BajaSur" , 0x038F5F }, - { "Mexico/General" , 0x0391A4 }, - { "MST" , 0x039402 }, - { "MST7MDT" , 0x039446 }, - { "Navajo" , 0x039797 }, - { "NZ" , 0x039B10 }, - { "NZ-CHAT" , 0x039E8E }, - { "Pacific/Apia" , 0x03A176 }, - { "Pacific/Auckland" , 0x03A312 }, - { "Pacific/Chatham" , 0x03A69E }, - { "Pacific/Chuuk" , 0x03A995 }, - { "Pacific/Easter" , 0x03A9EE }, - { "Pacific/Efate" , 0x03AD4C }, - { "Pacific/Enderbury" , 0x03AE12 }, - { "Pacific/Fakaofo" , 0x03AE80 }, - { "Pacific/Fiji" , 0x03AED1 }, - { "Pacific/Funafuti" , 0x03B064 }, - { "Pacific/Galapagos" , 0x03B0A8 }, - { "Pacific/Gambier" , 0x03B120 }, - { "Pacific/Guadalcanal" , 0x03B185 }, - { "Pacific/Guam" , 0x03B1DA }, - { "Pacific/Honolulu" , 0x03B230 }, - { "Pacific/Johnston" , 0x03B2A7 }, - { "Pacific/Kiritimati" , 0x03B2F9 }, - { "Pacific/Kosrae" , 0x03B364 }, - { "Pacific/Kwajalein" , 0x03B3C1 }, - { "Pacific/Majuro" , 0x03B42D }, - { "Pacific/Marquesas" , 0x03B48C }, - { "Pacific/Midway" , 0x03B4F3 }, - { "Pacific/Nauru" , 0x03B57D }, - { "Pacific/Niue" , 0x03B5F5 }, - { "Pacific/Norfolk" , 0x03B653 }, - { "Pacific/Noumea" , 0x03B6A8 }, - { "Pacific/Pago_Pago" , 0x03B738 }, - { "Pacific/Palau" , 0x03B7C1 }, - { "Pacific/Pitcairn" , 0x03B805 }, - { "Pacific/Pohnpei" , 0x03B85A }, - { "Pacific/Ponape" , 0x03B8AF }, - { "Pacific/Port_Moresby" , 0x03B8F4 }, - { "Pacific/Rarotonga" , 0x03B938 }, - { "Pacific/Saipan" , 0x03BA14 }, - { "Pacific/Samoa" , 0x03BA77 }, - { "Pacific/Tahiti" , 0x03BB00 }, - { "Pacific/Tarawa" , 0x03BB65 }, - { "Pacific/Tongatapu" , 0x03BBB9 }, - { "Pacific/Truk" , 0x03BC45 }, - { "Pacific/Wake" , 0x03BC8A }, - { "Pacific/Wallis" , 0x03BCDA }, - { "Pacific/Yap" , 0x03BD1E }, - { "Poland" , 0x03BD63 }, - { "Portugal" , 0x03C144 }, - { "PRC" , 0x03C640 }, - { "PST8PDT" , 0x03C6F1 }, - { "ROC" , 0x03CA42 }, - { "ROK" , 0x03CB5A }, - { "Singapore" , 0x03CBFE }, - { "Turkey" , 0x03CCB5 }, - { "UCT" , 0x03D0A2 }, - { "Universal" , 0x03D0E6 }, - { "US/Alaska" , 0x03D12A }, - { "US/Aleutian" , 0x03D493 }, - { "US/Arizona" , 0x03D7F9 }, - { "US/Central" , 0x03D887 }, - { "US/East-Indiana" , 0x03E291 }, - { "US/Eastern" , 0x03DD92 }, - { "US/Hawaii" , 0x03E4FB }, - { "US/Indiana-Starke" , 0x03E56C }, - { "US/Michigan" , 0x03E8DD }, - { "US/Mountain" , 0x03EC14 }, - { "US/Pacific" , 0x03EF8D }, - { "US/Pacific-New" , 0x03F392 }, - { "US/Samoa" , 0x03F797 }, - { "UTC" , 0x03F820 }, - { "W-SU" , 0x03FB17 }, - { "WET" , 0x03F864 }, - { "Zulu" , 0x03FD51 }, + { "America/Argentina/Buenos_Aires" , 0x002B72 }, + { "America/Argentina/Catamarca" , 0x002D20 }, + { "America/Argentina/ComodRivadavia" , 0x002EE1 }, + { "America/Argentina/Cordoba" , 0x003087 }, + { "America/Argentina/Jujuy" , 0x00325C }, + { "America/Argentina/La_Rioja" , 0x003410 }, + { "America/Argentina/Mendoza" , 0x0035C8 }, + { "America/Argentina/Rio_Gallegos" , 0x003788 }, + { "America/Argentina/Salta" , 0x00393D }, + { "America/Argentina/San_Juan" , 0x003AE9 }, + { "America/Argentina/San_Luis" , 0x003CA1 }, + { "America/Argentina/Tucuman" , 0x003E67 }, + { "America/Argentina/Ushuaia" , 0x004023 }, + { "America/Aruba" , 0x0041DE }, + { "America/Asuncion" , 0x004244 }, + { "America/Atikokan" , 0x004529 }, + { "America/Atka" , 0x0045FF }, + { "America/Bahia" , 0x004965 }, + { "America/Bahia_Banderas" , 0x004AF8 }, + { "America/Barbados" , 0x004D71 }, + { "America/Belem" , 0x004E0B }, + { "America/Belize" , 0x004F06 }, + { "America/Blanc-Sablon" , 0x005082 }, + { "America/Boa_Vista" , 0x005136 }, + { "America/Bogota" , 0x00523F }, + { "America/Boise" , 0x0052AB }, + { "America/Buenos_Aires" , 0x005642 }, + { "America/Cambridge_Bay" , 0x0057DB }, + { "America/Campo_Grande" , 0x005B03 }, + { "America/Cancun" , 0x005DF2 }, + { "America/Caracas" , 0x006034 }, + { "America/Catamarca" , 0x00609B }, + { "America/Cayenne" , 0x006241 }, + { "America/Cayman" , 0x0062A3 }, + { "America/Chicago" , 0x0062F8 }, + { "America/Chihuahua" , 0x00680F }, + { "America/Coral_Harbour" , 0x006A7A }, + { "America/Cordoba" , 0x006B0C }, + { "America/Costa_Rica" , 0x006CB2 }, + { "America/Creston" , 0x006D3C }, + { "America/Cuiaba" , 0x006DC8 }, + { "America/Curacao" , 0x0070A6 }, + { "America/Danmarkshavn" , 0x00710C }, + { "America/Dawson" , 0x007250 }, + { "America/Dawson_Creek" , 0x00756D }, + { "America/Denver" , 0x007747 }, + { "America/Detroit" , 0x007ACD }, + { "America/Dominica" , 0x007E2C }, + { "America/Edmonton" , 0x007E81 }, + { "America/Eirunepe" , 0x008239 }, + { "America/El_Salvador" , 0x00834C }, + { "America/Ensenada" , 0x0083C1 }, + { "America/Fort_Wayne" , 0x008868 }, + { "America/Fortaleza" , 0x00872A }, + { "America/Glace_Bay" , 0x008AD2 }, + { "America/Godthab" , 0x008E49 }, + { "America/Goose_Bay" , 0x00910D }, + { "America/Grand_Turk" , 0x0095CA }, + { "America/Grenada" , 0x009879 }, + { "America/Guadeloupe" , 0x0098CE }, + { "America/Guatemala" , 0x009923 }, + { "America/Guayaquil" , 0x0099AC }, + { "America/Guyana" , 0x009A09 }, + { "America/Halifax" , 0x009A8A }, + { "America/Havana" , 0x009FA0 }, + { "America/Hermosillo" , 0x00A313 }, + { "America/Indiana/Indianapolis" , 0x00A3F1 }, + { "America/Indiana/Knox" , 0x00A682 }, + { "America/Indiana/Marengo" , 0x00AA19 }, + { "America/Indiana/Petersburg" , 0x00ACBF }, + { "America/Indiana/Tell_City" , 0x00B20C }, + { "America/Indiana/Vevay" , 0x00B4A5 }, + { "America/Indiana/Vincennes" , 0x00B6E0 }, + { "America/Indiana/Winamac" , 0x00B994 }, + { "America/Indianapolis" , 0x00AFA2 }, + { "America/Inuvik" , 0x00BC4D }, + { "America/Iqaluit" , 0x00BF44 }, + { "America/Jamaica" , 0x00C266 }, + { "America/Jujuy" , 0x00C32B }, + { "America/Juneau" , 0x00C4D5 }, + { "America/Kentucky/Louisville" , 0x00C853 }, + { "America/Kentucky/Monticello" , 0x00CC71 }, + { "America/Knox_IN" , 0x00CFF6 }, + { "America/Kralendijk" , 0x00D367 }, + { "America/La_Paz" , 0x00D3CD }, + { "America/Lima" , 0x00D434 }, + { "America/Los_Angeles" , 0x00D4DC }, + { "America/Louisville" , 0x00D8ED }, + { "America/Lower_Princes" , 0x00DCE2 }, + { "America/Maceio" , 0x00DD48 }, + { "America/Managua" , 0x00DE82 }, + { "America/Manaus" , 0x00DF35 }, + { "America/Marigot" , 0x00E037 }, + { "America/Martinique" , 0x00E08C }, + { "America/Matamoros" , 0x00E0F8 }, + { "America/Mazatlan" , 0x00E351 }, + { "America/Mendoza" , 0x00E5BE }, + { "America/Menominee" , 0x00E772 }, + { "America/Merida" , 0x00EAF3 }, + { "America/Metlakatla" , 0x00ED2E }, + { "America/Mexico_City" , 0x00EE68 }, + { "America/Miquelon" , 0x00F0E3 }, + { "America/Moncton" , 0x00F355 }, + { "America/Monterrey" , 0x00F7EC }, + { "America/Montevideo" , 0x00FA4F }, + { "America/Montreal" , 0x00FD61 }, + { "America/Montserrat" , 0x010251 }, + { "America/Nassau" , 0x0102A6 }, + { "America/New_York" , 0x0105EB }, + { "America/Nipigon" , 0x010AF6 }, + { "America/Nome" , 0x010E47 }, + { "America/Noronha" , 0x0111C5 }, + { "America/North_Dakota/Beulah" , 0x0112F5 }, + { "America/North_Dakota/Center" , 0x011689 }, + { "America/North_Dakota/New_Salem" , 0x011A1D }, + { "America/Ojinaga" , 0x011DC6 }, + { "America/Panama" , 0x012027 }, + { "America/Pangnirtung" , 0x01207C }, + { "America/Paramaribo" , 0x0123B2 }, + { "America/Phoenix" , 0x012444 }, + { "America/Port-au-Prince" , 0x012502 }, + { "America/Port_of_Spain" , 0x012821 }, + { "America/Porto_Acre" , 0x012722 }, + { "America/Porto_Velho" , 0x012876 }, + { "America/Puerto_Rico" , 0x01296C }, + { "America/Rainy_River" , 0x0129D7 }, + { "America/Rankin_Inlet" , 0x012D0F }, + { "America/Recife" , 0x012FF5 }, + { "America/Regina" , 0x01311F }, + { "America/Resolute" , 0x0132DD }, + { "America/Rio_Branco" , 0x0135CE }, + { "America/Rosario" , 0x0136D1 }, + { "America/Santa_Isabel" , 0x013877 }, + { "America/Santarem" , 0x013C1A }, + { "America/Santiago" , 0x013D1F }, + { "America/Santo_Domingo" , 0x0140C8 }, + { "America/Sao_Paulo" , 0x01418E }, + { "America/Scoresbysund" , 0x01449D }, + { "America/Shiprock" , 0x01478B }, + { "America/Sitka" , 0x014B04 }, + { "America/St_Barthelemy" , 0x014E8C }, + { "America/St_Johns" , 0x014EE1 }, + { "America/St_Kitts" , 0x015434 }, + { "America/St_Lucia" , 0x015489 }, + { "America/St_Thomas" , 0x0154DE }, + { "America/St_Vincent" , 0x015533 }, + { "America/Swift_Current" , 0x015588 }, + { "America/Tegucigalpa" , 0x0156A9 }, + { "America/Thule" , 0x015728 }, + { "America/Thunder_Bay" , 0x01596F }, + { "America/Tijuana" , 0x015CB8 }, + { "America/Toronto" , 0x016051 }, + { "America/Tortola" , 0x016571 }, + { "America/Vancouver" , 0x0165C6 }, + { "America/Virgin" , 0x016A03 }, + { "America/Whitehorse" , 0x016A58 }, + { "America/Winnipeg" , 0x016D75 }, + { "America/Yakutat" , 0x0171B5 }, + { "America/Yellowknife" , 0x017520 }, + { "Antarctica/Casey" , 0x017830 }, + { "Antarctica/Davis" , 0x0178CD }, + { "Antarctica/DumontDUrville" , 0x01796E }, + { "Antarctica/Macquarie" , 0x017A00 }, + { "Antarctica/Mawson" , 0x017C47 }, + { "Antarctica/McMurdo" , 0x017CC3 }, + { "Antarctica/Palmer" , 0x01806E }, + { "Antarctica/Rothera" , 0x01838A }, + { "Antarctica/South_Pole" , 0x018400 }, + { "Antarctica/Syowa" , 0x01877E }, + { "Antarctica/Vostok" , 0x0187EC }, + { "Arctic/Longyearbyen" , 0x01885D }, + { "Asia/Aden" , 0x018B8F }, + { "Asia/Almaty" , 0x018BE4 }, + { "Asia/Amman" , 0x018D63 }, + { "Asia/Anadyr" , 0x018F35 }, + { "Asia/Aqtau" , 0x01911A }, + { "Asia/Aqtobe" , 0x019319 }, + { "Asia/Ashgabat" , 0x0194D1 }, + { "Asia/Ashkhabad" , 0x0195EE }, + { "Asia/Baghdad" , 0x01970B }, + { "Asia/Bahrain" , 0x019880 }, + { "Asia/Baku" , 0x0198E6 }, + { "Asia/Bangkok" , 0x019BCE }, + { "Asia/Beirut" , 0x019C23 }, + { "Asia/Bishkek" , 0x019F30 }, + { "Asia/Brunei" , 0x01A0DC }, + { "Asia/Calcutta" , 0x01A13E }, + { "Asia/Choibalsan" , 0x01A1B7 }, + { "Asia/Chongqing" , 0x01A330 }, + { "Asia/Chungking" , 0x01A41F }, + { "Asia/Colombo" , 0x01A4CE }, + { "Asia/Dacca" , 0x01A56A }, + { "Asia/Damascus" , 0x01A610 }, + { "Asia/Dhaka" , 0x01A960 }, + { "Asia/Dili" , 0x01AA06 }, + { "Asia/Dubai" , 0x01AA90 }, + { "Asia/Dushanbe" , 0x01AAE5 }, + { "Asia/Gaza" , 0x01ABE8 }, + { "Asia/Harbin" , 0x01AF3B }, + { "Asia/Hebron" , 0x01B022 }, + { "Asia/Ho_Chi_Minh" , 0x01B37E }, + { "Asia/Hong_Kong" , 0x01B3F6 }, + { "Asia/Hovd" , 0x01B5B8 }, + { "Asia/Irkutsk" , 0x01B730 }, + { "Asia/Istanbul" , 0x01B916 }, + { "Asia/Jakarta" , 0x01BD03 }, + { "Asia/Jayapura" , 0x01BDAD }, + { "Asia/Jerusalem" , 0x01BE49 }, + { "Asia/Kabul" , 0x01C178 }, + { "Asia/Kamchatka" , 0x01C1C9 }, + { "Asia/Karachi" , 0x01C3A5 }, + { "Asia/Kashgar" , 0x01C45A }, + { "Asia/Kathmandu" , 0x01C52B }, + { "Asia/Katmandu" , 0x01C591 }, + { "Asia/Khandyga" , 0x01C5F7 }, + { "Asia/Kolkata" , 0x01C81C }, + { "Asia/Krasnoyarsk" , 0x01C895 }, + { "Asia/Kuala_Lumpur" , 0x01CA7D }, + { "Asia/Kuching" , 0x01CB3A }, + { "Asia/Kuwait" , 0x01CC28 }, + { "Asia/Macao" , 0x01CC7D }, + { "Asia/Macau" , 0x01CDB8 }, + { "Asia/Magadan" , 0x01CEF3 }, + { "Asia/Makassar" , 0x01D0D5 }, + { "Asia/Manila" , 0x01D19A }, + { "Asia/Muscat" , 0x01D21F }, + { "Asia/Nicosia" , 0x01D274 }, + { "Asia/Novokuznetsk" , 0x01D55C }, + { "Asia/Novosibirsk" , 0x01D75E }, + { "Asia/Omsk" , 0x01D949 }, + { "Asia/Oral" , 0x01DB30 }, + { "Asia/Phnom_Penh" , 0x01DD00 }, + { "Asia/Pontianak" , 0x01DD78 }, + { "Asia/Pyongyang" , 0x01DE3A }, + { "Asia/Qatar" , 0x01DEA7 }, + { "Asia/Qyzylorda" , 0x01DF0D }, + { "Asia/Rangoon" , 0x01E0E3 }, + { "Asia/Riyadh" , 0x01E15B }, + { "Asia/Saigon" , 0x01E1B0 }, + { "Asia/Sakhalin" , 0x01E228 }, + { "Asia/Samarkand" , 0x01E41F }, + { "Asia/Seoul" , 0x01E555 }, + { "Asia/Shanghai" , 0x01E5F9 }, + { "Asia/Singapore" , 0x01E6D9 }, + { "Asia/Taipei" , 0x01E790 }, + { "Asia/Tashkent" , 0x01E8A8 }, + { "Asia/Tbilisi" , 0x01E9D9 }, + { "Asia/Tehran" , 0x01EB93 }, + { "Asia/Tel_Aviv" , 0x01EE01 }, + { "Asia/Thimbu" , 0x01F130 }, + { "Asia/Thimphu" , 0x01F196 }, + { "Asia/Tokyo" , 0x01F1FC }, + { "Asia/Ujung_Pandang" , 0x01F285 }, + { "Asia/Ulaanbaatar" , 0x01F302 }, + { "Asia/Ulan_Bator" , 0x01F45D }, + { "Asia/Urumqi" , 0x01F5AA }, + { "Asia/Ust-Nera" , 0x01F671 }, + { "Asia/Vientiane" , 0x01F876 }, + { "Asia/Vladivostok" , 0x01F8EE }, + { "Asia/Yakutsk" , 0x01FADA }, + { "Asia/Yekaterinburg" , 0x01FCBF }, + { "Asia/Yerevan" , 0x01FECA }, + { "Atlantic/Azores" , 0x0200CA }, + { "Atlantic/Bermuda" , 0x0205CD }, + { "Atlantic/Canary" , 0x0208AE }, + { "Atlantic/Cape_Verde" , 0x020B84 }, + { "Atlantic/Faeroe" , 0x020BFD }, + { "Atlantic/Faroe" , 0x020EA1 }, + { "Atlantic/Jan_Mayen" , 0x021145 }, + { "Atlantic/Madeira" , 0x021477 }, + { "Atlantic/Reykjavik" , 0x021980 }, + { "Atlantic/South_Georgia" , 0x021B39 }, + { "Atlantic/St_Helena" , 0x021D4B }, + { "Atlantic/Stanley" , 0x021B7D }, + { "Australia/ACT" , 0x021DA0 }, + { "Australia/Adelaide" , 0x0220BD }, + { "Australia/Brisbane" , 0x0223E9 }, + { "Australia/Broken_Hill" , 0x0224B0 }, + { "Australia/Canberra" , 0x0227EE }, + { "Australia/Currie" , 0x022B0B }, + { "Australia/Darwin" , 0x022E3E }, + { "Australia/Eucla" , 0x022EC4 }, + { "Australia/Hobart" , 0x022F99 }, + { "Australia/LHI" , 0x0232F7 }, + { "Australia/Lindeman" , 0x023592 }, + { "Australia/Lord_Howe" , 0x023673 }, + { "Australia/Melbourne" , 0x02391E }, + { "Australia/North" , 0x023C43 }, + { "Australia/NSW" , 0x023CB7 }, + { "Australia/Perth" , 0x023FD4 }, + { "Australia/Queensland" , 0x0240AC }, + { "Australia/South" , 0x024158 }, + { "Australia/Sydney" , 0x024475 }, + { "Australia/Tasmania" , 0x0247B2 }, + { "Australia/Victoria" , 0x024AF7 }, + { "Australia/West" , 0x024E14 }, + { "Australia/Yancowinna" , 0x024ECA }, + { "Brazil/Acre" , 0x0251EC }, + { "Brazil/DeNoronha" , 0x0252EB }, + { "Brazil/East" , 0x02540B }, + { "Brazil/West" , 0x0256E8 }, + { "Canada/Atlantic" , 0x0257E0 }, + { "Canada/Central" , 0x025CC8 }, + { "Canada/East-Saskatchewan" , 0x0265D2 }, + { "Canada/Eastern" , 0x0260E2 }, + { "Canada/Mountain" , 0x02675B }, + { "Canada/Newfoundland" , 0x026AD1 }, + { "Canada/Pacific" , 0x026FFC }, + { "Canada/Saskatchewan" , 0x027415 }, + { "Canada/Yukon" , 0x02759E }, + { "CET" , 0x0278A1 }, + { "Chile/Continental" , 0x027BAA }, + { "Chile/EasterIsland" , 0x027F45 }, + { "CST6CDT" , 0x028287 }, + { "Cuba" , 0x0285D8 }, + { "EET" , 0x02894B }, + { "Egypt" , 0x028BFE }, + { "Eire" , 0x028EC1 }, + { "EST" , 0x0293D2 }, + { "EST5EDT" , 0x029416 }, + { "Etc/GMT" , 0x029767 }, + { "Etc/GMT+0" , 0x029833 }, + { "Etc/GMT+1" , 0x0298BD }, + { "Etc/GMT+10" , 0x02994A }, + { "Etc/GMT+11" , 0x0299D8 }, + { "Etc/GMT+12" , 0x029A66 }, + { "Etc/GMT+2" , 0x029B81 }, + { "Etc/GMT+3" , 0x029C0D }, + { "Etc/GMT+4" , 0x029C99 }, + { "Etc/GMT+5" , 0x029D25 }, + { "Etc/GMT+6" , 0x029DB1 }, + { "Etc/GMT+7" , 0x029E3D }, + { "Etc/GMT+8" , 0x029EC9 }, + { "Etc/GMT+9" , 0x029F55 }, + { "Etc/GMT-0" , 0x0297EF }, + { "Etc/GMT-1" , 0x029877 }, + { "Etc/GMT-10" , 0x029903 }, + { "Etc/GMT-11" , 0x029991 }, + { "Etc/GMT-12" , 0x029A1F }, + { "Etc/GMT-13" , 0x029AAD }, + { "Etc/GMT-14" , 0x029AF4 }, + { "Etc/GMT-2" , 0x029B3B }, + { "Etc/GMT-3" , 0x029BC7 }, + { "Etc/GMT-4" , 0x029C53 }, + { "Etc/GMT-5" , 0x029CDF }, + { "Etc/GMT-6" , 0x029D6B }, + { "Etc/GMT-7" , 0x029DF7 }, + { "Etc/GMT-8" , 0x029E83 }, + { "Etc/GMT-9" , 0x029F0F }, + { "Etc/GMT0" , 0x0297AB }, + { "Etc/Greenwich" , 0x029F9B }, + { "Etc/UCT" , 0x029FDF }, + { "Etc/Universal" , 0x02A023 }, + { "Etc/UTC" , 0x02A067 }, + { "Etc/Zulu" , 0x02A0AB }, + { "Europe/Amsterdam" , 0x02A0EF }, + { "Europe/Andorra" , 0x02A52D }, + { "Europe/Athens" , 0x02A7A9 }, + { "Europe/Belfast" , 0x02AAEC }, + { "Europe/Belgrade" , 0x02B023 }, + { "Europe/Berlin" , 0x02B2EC }, + { "Europe/Bratislava" , 0x02B650 }, + { "Europe/Brussels" , 0x02B982 }, + { "Europe/Bucharest" , 0x02BDB9 }, + { "Europe/Budapest" , 0x02C0E3 }, + { "Europe/Busingen" , 0x02C456 }, + { "Europe/Chisinau" , 0x02C70D }, + { "Europe/Copenhagen" , 0x02CA9B }, + { "Europe/Dublin" , 0x02CDA5 }, + { "Europe/Gibraltar" , 0x02D2B6 }, + { "Europe/Guernsey" , 0x02D70D }, + { "Europe/Helsinki" , 0x02DC44 }, + { "Europe/Isle_of_Man" , 0x02DEFA }, + { "Europe/Istanbul" , 0x02E431 }, + { "Europe/Jersey" , 0x02E81E }, + { "Europe/Kaliningrad" , 0x02ED55 }, + { "Europe/Kiev" , 0x02EFBB }, + { "Europe/Lisbon" , 0x02F2D2 }, + { "Europe/Ljubljana" , 0x02F7D6 }, + { "Europe/London" , 0x02FA9F }, + { "Europe/Luxembourg" , 0x02FFD6 }, + { "Europe/Madrid" , 0x03042C }, + { "Europe/Malta" , 0x0307F2 }, + { "Europe/Mariehamn" , 0x030BAB }, + { "Europe/Minsk" , 0x030E61 }, + { "Europe/Monaco" , 0x03106F }, + { "Europe/Moscow" , 0x0314AA }, + { "Europe/Nicosia" , 0x0316FB }, + { "Europe/Oslo" , 0x0319E3 }, + { "Europe/Paris" , 0x031D15 }, + { "Europe/Podgorica" , 0x03215B }, + { "Europe/Prague" , 0x032424 }, + { "Europe/Riga" , 0x032756 }, + { "Europe/Rome" , 0x032A9B }, + { "Europe/Samara" , 0x032E5E }, + { "Europe/San_Marino" , 0x033091 }, + { "Europe/Sarajevo" , 0x033454 }, + { "Europe/Simferopol" , 0x03371D }, + { "Europe/Skopje" , 0x033A48 }, + { "Europe/Sofia" , 0x033D11 }, + { "Europe/Stockholm" , 0x034019 }, + { "Europe/Tallinn" , 0x0342C8 }, + { "Europe/Tirane" , 0x034602 }, + { "Europe/Tiraspol" , 0x034908 }, + { "Europe/Uzhgorod" , 0x034C96 }, + { "Europe/Vaduz" , 0x034FAD }, + { "Europe/Vatican" , 0x03525C }, + { "Europe/Vienna" , 0x03561F }, + { "Europe/Vilnius" , 0x03594C }, + { "Europe/Volgograd" , 0x035C8B }, + { "Europe/Warsaw" , 0x035E8B }, + { "Europe/Zagreb" , 0x03626C }, + { "Europe/Zaporozhye" , 0x036535 }, + { "Europe/Zurich" , 0x036876 }, + { "Factory" , 0x036B25 }, + { "GB" , 0x036B96 }, + { "GB-Eire" , 0x0370CD }, + { "GMT" , 0x037604 }, + { "GMT+0" , 0x0376D0 }, + { "GMT-0" , 0x03768C }, + { "GMT0" , 0x037648 }, + { "Greenwich" , 0x037714 }, + { "Hongkong" , 0x037758 }, + { "HST" , 0x03791A }, + { "Iceland" , 0x03795E }, + { "Indian/Antananarivo" , 0x037B17 }, + { "Indian/Chagos" , 0x037B8B }, + { "Indian/Christmas" , 0x037BED }, + { "Indian/Cocos" , 0x037C31 }, + { "Indian/Comoro" , 0x037C75 }, + { "Indian/Kerguelen" , 0x037CCA }, + { "Indian/Mahe" , 0x037D1F }, + { "Indian/Maldives" , 0x037D74 }, + { "Indian/Mauritius" , 0x037DC9 }, + { "Indian/Mayotte" , 0x037E3F }, + { "Indian/Reunion" , 0x037E94 }, + { "Iran" , 0x037EE9 }, + { "Israel" , 0x038157 }, + { "Jamaica" , 0x038486 }, + { "Japan" , 0x03854B }, + { "Kwajalein" , 0x0385D4 }, + { "Libya" , 0x038637 }, + { "MET" , 0x038830 }, + { "Mexico/BajaNorte" , 0x038B39 }, + { "Mexico/BajaSur" , 0x038EA2 }, + { "Mexico/General" , 0x0390E7 }, + { "MST" , 0x039345 }, + { "MST7MDT" , 0x039389 }, + { "Navajo" , 0x0396DA }, + { "NZ" , 0x039A53 }, + { "NZ-CHAT" , 0x039DD1 }, + { "Pacific/Apia" , 0x03A0B9 }, + { "Pacific/Auckland" , 0x03A255 }, + { "Pacific/Chatham" , 0x03A5E1 }, + { "Pacific/Chuuk" , 0x03A8D8 }, + { "Pacific/Easter" , 0x03A931 }, + { "Pacific/Efate" , 0x03AC8F }, + { "Pacific/Enderbury" , 0x03AD55 }, + { "Pacific/Fakaofo" , 0x03ADC3 }, + { "Pacific/Fiji" , 0x03AE14 }, + { "Pacific/Funafuti" , 0x03AFA7 }, + { "Pacific/Galapagos" , 0x03AFEB }, + { "Pacific/Gambier" , 0x03B063 }, + { "Pacific/Guadalcanal" , 0x03B0C8 }, + { "Pacific/Guam" , 0x03B11D }, + { "Pacific/Honolulu" , 0x03B173 }, + { "Pacific/Johnston" , 0x03B1EA }, + { "Pacific/Kiritimati" , 0x03B269 }, + { "Pacific/Kosrae" , 0x03B2D4 }, + { "Pacific/Kwajalein" , 0x03B331 }, + { "Pacific/Majuro" , 0x03B39D }, + { "Pacific/Marquesas" , 0x03B3FC }, + { "Pacific/Midway" , 0x03B463 }, + { "Pacific/Nauru" , 0x03B4ED }, + { "Pacific/Niue" , 0x03B565 }, + { "Pacific/Norfolk" , 0x03B5C3 }, + { "Pacific/Noumea" , 0x03B618 }, + { "Pacific/Pago_Pago" , 0x03B6A8 }, + { "Pacific/Palau" , 0x03B731 }, + { "Pacific/Pitcairn" , 0x03B775 }, + { "Pacific/Pohnpei" , 0x03B7CA }, + { "Pacific/Ponape" , 0x03B81F }, + { "Pacific/Port_Moresby" , 0x03B864 }, + { "Pacific/Rarotonga" , 0x03B8A8 }, + { "Pacific/Saipan" , 0x03B984 }, + { "Pacific/Samoa" , 0x03B9E7 }, + { "Pacific/Tahiti" , 0x03BA70 }, + { "Pacific/Tarawa" , 0x03BAD5 }, + { "Pacific/Tongatapu" , 0x03BB29 }, + { "Pacific/Truk" , 0x03BBB5 }, + { "Pacific/Wake" , 0x03BBFA }, + { "Pacific/Wallis" , 0x03BC4A }, + { "Pacific/Yap" , 0x03BC8E }, + { "Poland" , 0x03BCD3 }, + { "Portugal" , 0x03C0B4 }, + { "PRC" , 0x03C5B0 }, + { "PST8PDT" , 0x03C661 }, + { "ROC" , 0x03C9B2 }, + { "ROK" , 0x03CACA }, + { "Singapore" , 0x03CB6E }, + { "Turkey" , 0x03CC25 }, + { "UCT" , 0x03D012 }, + { "Universal" , 0x03D056 }, + { "US/Alaska" , 0x03D09A }, + { "US/Aleutian" , 0x03D403 }, + { "US/Arizona" , 0x03D769 }, + { "US/Central" , 0x03D7F7 }, + { "US/East-Indiana" , 0x03E201 }, + { "US/Eastern" , 0x03DD02 }, + { "US/Hawaii" , 0x03E46B }, + { "US/Indiana-Starke" , 0x03E4DC }, + { "US/Michigan" , 0x03E84D }, + { "US/Mountain" , 0x03EB84 }, + { "US/Pacific" , 0x03EEFD }, + { "US/Pacific-New" , 0x03F302 }, + { "US/Samoa" , 0x03F707 }, + { "UTC" , 0x03F790 }, + { "W-SU" , 0x03FA87 }, + { "WET" , 0x03F7D4 }, + { "Zulu" , 0x03FCC1 }, }; /* This is a generated file, do not modify */ -const unsigned char timelib_timezone_db_data_builtin[261525] = { +const unsigned char timelib_timezone_db_data_builtin[261381] = { /* Africa/Abidjan */ @@ -766,8 +766,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x18, 0x6F, 0xF0, 0x48, 0x41, 0xE6, 0x80, 0x48, 0xBB, 0x22, 0x70, 0x4A, 0x23, 0x1A, 0x00, 0x4A, 0x8D, 0xD5, 0x70, 0x4B, 0xDC, 0xC0, 0x80, 0x4C, 0x5D, 0xE5, 0x70, 0x4D, 0x97, 0xB8, 0x80, 0x4E, 0x34, 0x8C, 0xF0, 0x4F, 0x9C, 0xA0, 0xA0, 0x50, 0x08, 0xBB, 0xA0, -0x50, 0x31, 0x9A, 0x20, 0x50, 0x67, 0xA7, 0xA0, 0x51, 0x7C, 0x82, 0xA0, 0x51, 0xDB, 0x6E, 0xA0, -0x52, 0x02, 0xFB, 0xA0, 0x52, 0x47, 0x89, 0xA0, 0x53, 0x5C, 0x64, 0xA0, 0x53, 0xAF, 0x73, 0x20, +0x50, 0x31, 0x9A, 0x20, 0x50, 0x67, 0xA7, 0xA0, 0x51, 0x7C, 0x82, 0xA0, 0x51, 0xD8, 0xCB, 0xA0, +0x52, 0x05, 0x9E, 0xA0, 0x52, 0x47, 0x89, 0xA0, 0x53, 0x5C, 0x64, 0xA0, 0x53, 0xAF, 0x73, 0x20, 0x53, 0xD7, 0x00, 0x20, 0x54, 0x27, 0x6B, 0xA0, 0x55, 0x3C, 0x46, 0xA0, 0x55, 0x82, 0x26, 0x20, 0x55, 0xA9, 0xB3, 0x20, 0x56, 0x07, 0x4D, 0xA0, 0x57, 0x1C, 0x28, 0xA0, 0x57, 0x56, 0x2A, 0xA0, 0x57, 0x7D, 0xB7, 0xA0, 0x57, 0xE7, 0x2F, 0xA0, 0x59, 0x05, 0x45, 0x20, 0x59, 0x28, 0xDD, 0xA0, @@ -945,7 +945,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Africa/Juba */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x53, 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, 0x22, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xDA, 0xE0, +0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xDA, 0x00, 0x00, 0x9E, 0x17, 0xE0, 0x01, 0x7A, 0x34, 0x50, 0x02, 0x7D, 0xF9, 0xE0, 0x03, 0x5B, 0x67, 0xD0, 0x04, 0x60, 0x7E, 0xE0, 0x05, 0x3D, 0xEC, 0xD0, 0x06, 0x40, 0x60, 0xE0, 0x07, 0x1F, 0x20, 0x50, 0x08, 0x20, 0x42, 0xE0, 0x09, 0x00, 0x53, 0xD0, 0x0A, 0x00, 0x24, 0xE0, 0x0A, 0xE1, 0x87, 0x50, @@ -956,7 +956,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x1A, 0xF1, 0x8B, 0xE0, 0x1B, 0xD0, 0x4B, 0x50, 0x1C, 0xD1, 0x6D, 0xE0, 0x1D, 0xB1, 0x7E, 0xD0, 0x38, 0x80, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, 0x1D, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, +0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, 0x1E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0xBA, 0xC8, 0x01, 0x42, 0xE0, 0x40, 0x00, @@ -1390,8 +1390,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Anguilla */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x49, 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, 0x93, 0x37, 0x35, 0x20, -0x01, 0xFF, 0xFF, 0xC4, 0xE0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x19, 0xA0, 0x00, 0xB2, 0x6D, 0x15, 0x00, 0x00, 0x00, 0x00, @@ -1407,7 +1407,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Araguaina */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 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, 0x64, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x30, +0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x30, 0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, 0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, @@ -1420,29 +1420,14 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, 0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, -0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x00, 0x1B, 0xA0, -0x54, 0x43, 0x29, 0x30, 0x54, 0xE9, 0x38, 0x20, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xC9, 0x1A, 0x20, -0x58, 0x02, 0xED, 0x30, 0x58, 0xA8, 0xFC, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0x88, 0xDE, 0x20, -0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x68, 0xC0, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x48, 0xA2, 0x20, -0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x31, 0xBE, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x11, 0xA0, 0xA0, -0x63, 0x4B, 0x73, 0xB0, 0x63, 0xFA, 0xBD, 0x20, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xD1, 0x64, 0xA0, -0x67, 0x14, 0x72, 0x30, 0x67, 0xB1, 0x46, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0x9A, 0x63, 0x20, -0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x7A, 0x45, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x5A, 0x27, 0x20, -0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x3A, 0x09, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x19, 0xEB, 0x20, -0x72, 0x5C, 0xF8, 0xB0, 0x72, 0xF9, 0xCD, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x74, 0xD9, 0xAF, 0x20, -0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xC2, 0xCB, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xAB, 0xE8, 0x20, -0x79, 0xDC, 0x80, 0xB0, 0x7A, 0x82, 0x8F, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x62, 0x71, 0xA0, -0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x4B, 0x8E, 0x20, 0x7F, 0x85, 0x61, 0x30, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0xFF, 0xFF, 0xD2, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x57, 0xC0, 0x00, 0xC9, 0x1C, 0x60, 0x00, 0x00, 0x00, -0x09, 0x54, 0x6F, 0x63, 0x61, 0x6E, 0x74, 0x69, 0x6E, 0x73, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xD2, 0xD0, 0x00, +0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, +0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x7E, 0x57, 0xC0, 0x00, 0xC9, 0x1C, 0x60, 0x00, 0x00, 0x00, 0x09, 0x54, 0x6F, 0x63, 0x61, +0x6E, 0x74, 0x69, 0x6E, 0x73, /* America/Argentina/Buenos_Aires */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1767,7 +1752,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 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, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, -0x06, 0x05, 0x04, 0x06, 0x04, 0x05, 0x04, 0x03, 0x06, 0x05, 0x06, 0x05, 0x06, 0xFF, 0xFF, 0xC3, +0x06, 0x05, 0x04, 0x06, 0x04, 0x05, 0x04, 0x03, 0x06, 0x05, 0x06, 0x05, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, @@ -1839,8 +1824,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Aruba */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 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, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x1E, 0x2F, 0x38, -0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xBE, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8, +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x1E, 0x2E, 0x23, +0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xBF, 0x5D, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4E, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x67, 0x10, 0x00, 0xA7, 0xE5, 0xC5, 0x00, 0x00, 0x00, 0x00, @@ -2414,8 +2399,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Cayman */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x59, 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, 0x93, 0x0F, 0xB5, 0x00, -0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x4B, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x0F, 0xB4, 0xFF, +0x01, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA6, 0xC7, 0x50, 0x00, 0x96, 0x7A, 0x22, 0x00, 0x00, 0x00, 0x00, @@ -2889,8 +2874,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Dominica */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x34, 0x4C, -0x01, 0xFF, 0xFF, 0xC6, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xAC, 0xD0, 0x00, 0xB4, 0xF8, 0x20, 0x00, 0x00, 0x00, 0x00, @@ -3292,7 +3277,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Grand_Turk */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00, +0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, @@ -3330,23 +3315,23 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 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, 0xFF, -0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, +0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E, 0x0A, 0x00, 0x00, 0x00, 0x00, /* America/Grenada */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x34, 0x64, -0x01, 0xFF, 0xFF, 0xC6, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0xB7, 0x48, 0x00, 0xB4, 0x6F, 0x68, 0x00, 0x00, 0x00, 0x00, /* America/Guadeloupe */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2, 0x19, 0x65, 0x00, 0xB4, 0xC4, 0x0A, 0x00, 0x00, 0x00, 0x00, @@ -4057,17 +4042,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Jamaica */ 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, 0xB5, 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, 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, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, +0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, -0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xCB, 0x80, 0x00, 0x9D, 0x78, -0x80, 0x00, 0x00, 0x00, 0x00, +0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xBF, 0x05, 0x00, 0x9D, 0x7B, +0x1A, 0x00, 0x00, 0x00, 0x00, /* America/Jujuy */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -4573,8 +4558,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Marigot */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xE5, 0x8A, 0x00, 0xB2, 0x66, 0x92, 0x00, 0x00, 0x00, 0x00, @@ -5071,7 +5056,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x00, 0x00, /* America/Montreal */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +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, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9C, 0xBD, 0x01, 0xF0, 0x9C, 0xE4, 0x64, 0xC0, 0x9E, 0xB8, 0x93, 0x70, 0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x87, 0x58, 0xF8, @@ -5149,16 +5134,14 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x01, 0x00, 0xCE, 0xC8, 0x32, 0x00, 0xA2, 0x67, 0x85, 0x00, 0x00, 0x00, 0x26, -0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x51, -0x75, 0x65, 0x62, 0x65, 0x63, 0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, -0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, +0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, + /* America/Montserrat */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x35, 0x10, -0x01, 0xFF, 0xFF, 0xC5, 0xAC, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2, 0xD6, 0x32, 0x00, 0xB3, 0xB9, 0x1D, 0x00, 0x00, 0x00, 0x00, @@ -5741,9 +5724,10 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0xFB, 0xE8, 0x58, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xBC, 0x5E, 0x01, 0x00, 0x67, 0xA5, 0xDA, 0x00, 0x00, 0x00, 0x20, 0x4D, 0x6F, +0x00, 0x00, 0x00, 0xBC, 0x5E, 0x01, 0x00, 0x67, 0xA5, 0xDA, 0x00, 0x00, 0x00, 0x30, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, -0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x41, 0x72, 0x69, 0x7A, 0x6F, 0x6E, 0x61, +0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x41, 0x72, 0x69, 0x7A, 0x6F, 0x6E, 0x61, 0x20, 0x28, +0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x4E, 0x61, 0x76, 0x61, 0x6A, 0x6F, 0x29, /* America/Port-au-Prince */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -6344,7 +6328,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x74, 0x6F, 0x71, 0x71, 0x6F, 0x72, 0x74, 0x6F, 0x6F, 0x72, 0x6D, 0x69, 0x69, 0x74, /* America/Shiprock */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +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, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, 0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, @@ -6398,9 +6382,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xC1, 0x75, -0x9B, 0x00, 0x6C, 0xD0, 0xE1, 0x00, 0x00, 0x00, 0x16, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, -0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4E, 0x61, 0x76, 0x61, 0x6A, 0x6F, +0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, +0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, /* America/Sitka */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -6464,8 +6447,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/St_Barthelemy */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0x9D, 0xED, 0x00, 0xB2, 0xC1, 0xB8, 0x00, 0x00, 0x00, 0x00, @@ -6560,32 +6543,32 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/St_Kitts */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x4E, 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, 0x93, 0x37, 0x34, 0xCC, -0x01, 0xFF, 0xFF, 0xC5, 0x34, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA3, 0xBA, 0x10, 0x00, 0xB2, 0xF5, 0xCD, 0x00, 0x00, 0x00, 0x00, /* America/St_Lucia */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x43, 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, 0x92, 0xE6, 0xC7, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x43, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9E, 0xB7, 0x82, 0x00, 0xB5, 0x94, 0x60, 0x00, 0x00, 0x00, 0x00, /* America/St_Thomas */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x60, -0x01, 0xFF, 0xFF, 0xC3, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x54, 0x38, 0x00, 0xAF, 0x93, 0xEA, 0x00, 0x00, 0x00, 0x00, /* America/St_Vincent */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x43, 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, 0x92, 0xE6, 0xC7, 0xE8, -0x01, 0xFF, 0xFF, 0xC6, 0x98, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4B, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0x64, 0xF8, 0x00, 0xB5, 0x39, 0x3A, 0x00, 0x00, 0x00, 0x00, @@ -6853,16 +6836,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x01, 0x00, 0xCB, 0xEF, 0x08, 0x00, 0x99, 0x87, 0x62, 0x00, 0x00, 0x00, 0x27, +0x00, 0x00, 0x00, 0x01, 0x00, 0xCB, 0xEF, 0x08, 0x00, 0x99, 0x87, 0x62, 0x00, 0x00, 0x00, 0x30, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4F, -0x6E, 0x74, 0x61, 0x72, 0x69, 0x6F, 0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, -0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, +0x6E, 0x74, 0x61, 0x72, 0x69, 0x6F, 0x20, 0x26, 0x20, 0x51, 0x75, 0x65, 0x62, 0x65, 0x63, 0x20, +0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, + /* America/Tortola */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x14, -0x01, 0xFF, 0xFF, 0xC3, 0x6C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x7B, 0x48, 0x00, 0xB0, 0x0F, 0x9D, 0x00, 0x00, 0x00, 0x00, @@ -6939,8 +6923,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Virgin */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x60, -0x01, 0xFF, 0xFF, 0xC3, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, @@ -7248,7 +7232,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x08, 0x45, 0x53, 0x54, 0x00, 0x7A, 0x7A, 0x7A, 0x00, 0x4D, 0x49, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x2B, 0x30, 0x02, +0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x2B, 0x30, 0x02, 0x05, 0x32, 0x58, 0x00, 0x00, 0x00, 0x10, 0x4D, 0x61, 0x63, 0x71, 0x75, 0x61, 0x72, 0x69, 0x65, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, @@ -7264,54 +7248,64 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Antarctica/McMurdo */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 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, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0E, 0xE5, 0xA9, 0xE9, 0x00, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, -0x48, 0xDE, 0x3C, 0x60, 0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, -0x4C, 0x9E, 0x00, 0x60, 0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, -0x50, 0x66, 0xFE, 0xE0, 0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, -0x54, 0x26, 0xC2, 0xE0, 0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, -0x57, 0xE6, 0x86, 0xE0, 0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, -0x5B, 0xAF, 0x85, 0x60, 0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, -0x5F, 0x6F, 0x49, 0x60, 0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, -0x63, 0x2F, 0x0D, 0x60, 0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, -0x66, 0xF8, 0x0B, 0xE0, 0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, -0x6A, 0xB7, 0xCF, 0xE0, 0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, -0x6E, 0x77, 0x93, 0xE0, 0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, -0x72, 0x40, 0x92, 0x60, 0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, -0x76, 0x00, 0x56, 0x60, 0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, -0x79, 0xC0, 0x1A, 0x60, 0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, -0x7D, 0x89, 0x18, 0xE0, 0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0xB4, 0xB2, 0xE8, +0xB1, 0x51, 0x87, 0x58, 0xB2, 0x78, 0xE5, 0x68, 0xB3, 0x43, 0xE5, 0x60, 0xB4, 0x58, 0xC7, 0x68, +0xB5, 0x23, 0xC7, 0x60, 0xB6, 0x38, 0xA9, 0x68, 0xB7, 0x03, 0xA9, 0x60, 0xB8, 0x18, 0x8B, 0x68, +0xB8, 0xEC, 0xC5, 0xE0, 0xB9, 0xF8, 0x6D, 0x68, 0xBA, 0xCC, 0xA7, 0xE0, 0xBB, 0xD8, 0x4F, 0x68, +0xBC, 0xE3, 0xE8, 0xE0, 0xBD, 0xAE, 0xF6, 0xE8, 0xBE, 0xC3, 0xCA, 0xE0, 0xBF, 0x8E, 0xD8, 0xE8, +0xC0, 0xA3, 0xAC, 0xE0, 0xC1, 0x6E, 0xBA, 0xE8, 0xC2, 0x83, 0x8E, 0xE0, 0xC3, 0x4E, 0x9C, 0xE8, +0xC4, 0x63, 0x70, 0xE0, 0xC5, 0x2E, 0x7E, 0xE8, 0xC6, 0x4C, 0x8D, 0x60, 0xC7, 0x0E, 0x60, 0xE8, +0xC8, 0x2C, 0x6F, 0x60, 0xC8, 0xF7, 0x7D, 0x68, 0xD2, 0xDA, 0x9A, 0x40, 0x09, 0x18, 0xFD, 0xE0, +0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, 0x0C, 0xD8, 0xC1, 0xE0, +0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, 0x10, 0x98, 0x85, 0xE0, +0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, 0x14, 0x58, 0x49, 0xE0, +0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, 0x18, 0x21, 0x48, 0x60, +0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, 0x1B, 0xE1, 0x0C, 0x60, +0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, 0x1F, 0xA0, 0xD0, 0x60, +0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, 0x23, 0x69, 0xCE, 0xE0, +0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, 0x27, 0x0D, 0xE3, 0x60, +0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, 0x2A, 0xCD, 0xA7, 0x60, +0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, 0x2E, 0x8D, 0x6B, 0x60, +0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, 0x32, 0x56, 0x69, 0xE0, +0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, 0x36, 0x16, 0x2D, 0xE0, +0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, 0x39, 0xD5, 0xF1, 0xE0, +0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, 0x3D, 0x9E, 0xF0, 0x60, +0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, 0x41, 0x5E, 0xB4, 0x60, +0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, 0x45, 0x1E, 0x78, 0x60, +0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, 0x48, 0xDE, 0x3C, 0x60, +0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, 0x4C, 0x9E, 0x00, 0x60, +0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, 0x50, 0x66, 0xFE, 0xE0, +0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, 0x54, 0x26, 0xC2, 0xE0, +0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, 0x57, 0xE6, 0x86, 0xE0, +0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, 0x5B, 0xAF, 0x85, 0x60, +0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, 0x5F, 0x6F, 0x49, 0x60, +0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, 0x63, 0x2F, 0x0D, 0x60, +0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, 0x66, 0xF8, 0x0B, 0xE0, +0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, 0x6A, 0xB7, 0xCF, 0xE0, +0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, 0x6E, 0x77, 0x93, 0xE0, +0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, 0x72, 0x40, 0x92, 0x60, +0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, 0x76, 0x00, 0x56, 0x60, +0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, 0x79, 0xC0, 0x1A, 0x60, +0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, 0x7D, 0x89, 0x18, 0xE0, +0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x00, 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, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x00, 0x00, -0xA8, 0xC0, 0x00, 0x09, 0x7A, 0x7A, 0x7A, 0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x4E, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x90, 0x9A, 0x02, 0x10, -0xDE, 0xA0, 0x00, 0x00, 0x00, 0x1C, 0x4D, 0x63, 0x4D, 0x75, 0x72, 0x64, 0x6F, 0x20, 0x53, 0x74, -0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x52, 0x6F, 0x73, 0x73, 0x20, 0x49, 0x73, 0x6C, 0x61, -0x6E, 0x64, +0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x00, 0x00, 0xAF, 0xC8, 0x01, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x05, 0x00, +0x00, 0xA8, 0xC0, 0x01, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x0A, 0x00, 0x00, 0xA8, 0xC0, 0x00, +0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4E, 0x5A, 0x53, 0x54, 0x00, 0x4E, 0x5A, 0x4D, 0x54, +0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x12, 0x90, 0x9A, 0x02, 0x10, 0xDE, 0xA0, 0x00, 0x00, 0x00, 0x2D, 0x4D, 0x63, +0x4D, 0x75, 0x72, 0x64, 0x6F, 0x2C, 0x20, 0x53, 0x6F, 0x75, 0x74, 0x68, 0x20, 0x50, 0x6F, 0x6C, +0x65, 0x2C, 0x20, 0x53, 0x63, 0x6F, 0x74, 0x74, 0x20, 0x28, 0x4E, 0x65, 0x77, 0x20, 0x5A, 0x65, +0x61, 0x6C, 0x61, 0x6E, 0x64, 0x20, 0x74, 0x69, 0x6D, 0x65, 0x29, /* Antarctica/Palmer */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -7376,55 +7370,62 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, /* Antarctica/South_Pole */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 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, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0E, 0xE5, 0xA9, 0xE9, 0x00, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, -0x48, 0xDE, 0x3C, 0x60, 0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, -0x4C, 0x9E, 0x00, 0x60, 0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, -0x50, 0x66, 0xFE, 0xE0, 0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, -0x54, 0x26, 0xC2, 0xE0, 0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, -0x57, 0xE6, 0x86, 0xE0, 0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, -0x5B, 0xAF, 0x85, 0x60, 0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, -0x5F, 0x6F, 0x49, 0x60, 0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, -0x63, 0x2F, 0x0D, 0x60, 0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, -0x66, 0xF8, 0x0B, 0xE0, 0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, -0x6A, 0xB7, 0xCF, 0xE0, 0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, -0x6E, 0x77, 0x93, 0xE0, 0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, -0x72, 0x40, 0x92, 0x60, 0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, -0x76, 0x00, 0x56, 0x60, 0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, -0x79, 0xC0, 0x1A, 0x60, 0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, -0x7D, 0x89, 0x18, 0xE0, 0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0xB4, 0xB2, 0xE8, +0xB1, 0x51, 0x87, 0x58, 0xB2, 0x78, 0xE5, 0x68, 0xB3, 0x43, 0xE5, 0x60, 0xB4, 0x58, 0xC7, 0x68, +0xB5, 0x23, 0xC7, 0x60, 0xB6, 0x38, 0xA9, 0x68, 0xB7, 0x03, 0xA9, 0x60, 0xB8, 0x18, 0x8B, 0x68, +0xB8, 0xEC, 0xC5, 0xE0, 0xB9, 0xF8, 0x6D, 0x68, 0xBA, 0xCC, 0xA7, 0xE0, 0xBB, 0xD8, 0x4F, 0x68, +0xBC, 0xE3, 0xE8, 0xE0, 0xBD, 0xAE, 0xF6, 0xE8, 0xBE, 0xC3, 0xCA, 0xE0, 0xBF, 0x8E, 0xD8, 0xE8, +0xC0, 0xA3, 0xAC, 0xE0, 0xC1, 0x6E, 0xBA, 0xE8, 0xC2, 0x83, 0x8E, 0xE0, 0xC3, 0x4E, 0x9C, 0xE8, +0xC4, 0x63, 0x70, 0xE0, 0xC5, 0x2E, 0x7E, 0xE8, 0xC6, 0x4C, 0x8D, 0x60, 0xC7, 0x0E, 0x60, 0xE8, +0xC8, 0x2C, 0x6F, 0x60, 0xC8, 0xF7, 0x7D, 0x68, 0xD2, 0xDA, 0x9A, 0x40, 0x09, 0x18, 0xFD, 0xE0, +0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, 0x0C, 0xD8, 0xC1, 0xE0, +0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, 0x10, 0x98, 0x85, 0xE0, +0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, 0x14, 0x58, 0x49, 0xE0, +0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, 0x18, 0x21, 0x48, 0x60, +0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, 0x1B, 0xE1, 0x0C, 0x60, +0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, 0x1F, 0xA0, 0xD0, 0x60, +0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, 0x23, 0x69, 0xCE, 0xE0, +0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, 0x27, 0x0D, 0xE3, 0x60, +0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, 0x2A, 0xCD, 0xA7, 0x60, +0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, 0x2E, 0x8D, 0x6B, 0x60, +0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, 0x32, 0x56, 0x69, 0xE0, +0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, 0x36, 0x16, 0x2D, 0xE0, +0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, 0x39, 0xD5, 0xF1, 0xE0, +0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, 0x3D, 0x9E, 0xF0, 0x60, +0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, 0x41, 0x5E, 0xB4, 0x60, +0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, 0x45, 0x1E, 0x78, 0x60, +0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, 0x48, 0xDE, 0x3C, 0x60, +0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, 0x4C, 0x9E, 0x00, 0x60, +0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, 0x50, 0x66, 0xFE, 0xE0, +0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, 0x54, 0x26, 0xC2, 0xE0, +0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, 0x57, 0xE6, 0x86, 0xE0, +0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, 0x5B, 0xAF, 0x85, 0x60, +0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, 0x5F, 0x6F, 0x49, 0x60, +0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, 0x63, 0x2F, 0x0D, 0x60, +0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, 0x66, 0xF8, 0x0B, 0xE0, +0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, 0x6A, 0xB7, 0xCF, 0xE0, +0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, 0x6E, 0x77, 0x93, 0xE0, +0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, 0x72, 0x40, 0x92, 0x60, +0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, 0x76, 0x00, 0x56, 0x60, +0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, 0x79, 0xC0, 0x1A, 0x60, +0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, 0x7D, 0x89, 0x18, 0xE0, +0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x00, 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, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x00, 0x00, -0xA8, 0xC0, 0x00, 0x09, 0x7A, 0x7A, 0x7A, 0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x4E, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x22, 0x41, 0x6D, 0x75, 0x6E, 0x64, 0x73, 0x65, 0x6E, 0x2D, 0x53, -0x63, 0x6F, 0x74, 0x74, 0x20, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x53, 0x6F, -0x75, 0x74, 0x68, 0x20, 0x50, 0x6F, 0x6C, 0x65, +0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x00, 0x00, 0xAF, 0xC8, 0x01, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x05, 0x00, +0x00, 0xA8, 0xC0, 0x01, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x0A, 0x00, 0x00, 0xA8, 0xC0, 0x00, +0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4E, 0x5A, 0x53, 0x54, 0x00, 0x4E, 0x5A, 0x4D, 0x54, +0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, /* Antarctica/Syowa */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -7535,8 +7536,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Asia/Amman */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA3, 0xD6, 0xD0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xD6, 0xD0, 0x06, 0x72, 0x79, 0xE0, 0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0, 0x0A, 0x05, 0x6A, 0xE0, 0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xDA, 0x75, 0xD0, 0x0D, 0xC9, 0x23, 0x60, 0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0, @@ -7553,31 +7554,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x42, 0x4C, 0x72, 0xE0, 0x43, 0x3C, 0x63, 0xE0, 0x44, 0x2C, 0x54, 0xE0, 0x45, 0x41, 0x2F, 0xE0, 0x46, 0x0C, 0x36, 0xE0, 0x47, 0x21, 0x11, 0xE0, 0x47, 0xEC, 0x18, 0xE0, 0x49, 0x0A, 0x2E, 0x60, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xEA, 0x10, 0x60, 0x4B, 0xAB, 0xDC, 0xE0, 0x4C, 0xC9, 0xF2, 0x60, -0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x52, 0x69, 0x98, 0x60, -0x53, 0x34, 0x9F, 0x60, 0x54, 0x52, 0xB4, 0xE0, 0x55, 0x14, 0x81, 0x60, 0x56, 0x32, 0x96, 0xE0, -0x56, 0xFD, 0x9D, 0xE0, 0x58, 0x12, 0x78, 0xE0, 0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xF2, 0x5A, 0xE0, -0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xD2, 0x3C, 0xE0, 0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0xB2, 0x1E, 0xE0, -0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x9B, 0x3B, 0x60, 0x60, 0x5D, 0x07, 0xE0, 0x61, 0x7B, 0x1D, 0x60, -0x62, 0x46, 0x24, 0x60, 0x63, 0x5A, 0xFF, 0x60, 0x64, 0x26, 0x06, 0x60, 0x65, 0x3A, 0xE1, 0x60, -0x66, 0x05, 0xE8, 0x60, 0x67, 0x1A, 0xC3, 0x60, 0x67, 0xE5, 0xCA, 0x60, 0x69, 0x03, 0xDF, 0xE0, -0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xE3, 0xC1, 0xE0, 0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0xC3, 0xA3, 0xE0, -0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0xA3, 0x85, 0xE0, 0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x83, 0x67, 0xE0, -0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x63, 0x49, 0xE0, 0x73, 0x2E, 0x50, 0xE0, 0x74, 0x4C, 0x66, 0x60, -0x75, 0x0E, 0x32, 0xE0, 0x76, 0x2C, 0x48, 0x60, 0x76, 0xF7, 0x4F, 0x60, 0x78, 0x0C, 0x2A, 0x60, -0x78, 0xD7, 0x31, 0x60, 0x79, 0xEC, 0x0C, 0x60, 0x7A, 0xB7, 0x13, 0x60, 0x7B, 0xCB, 0xEE, 0x60, -0x7C, 0x96, 0xF5, 0x60, 0x7D, 0xB5, 0x0A, 0xE0, 0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x94, 0xEC, 0xE0, +0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x89, 0xB6, 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, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x03, 0x01, 0x03, 0x01, 0x05, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, -0x7C, 0xF5, 0x00, 0x00, 0x00, 0x00, +0x30, 0x01, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, +0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, 0x7C, 0xF5, 0x00, 0x00, +0x00, 0x00, /* Asia/Anadyr */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8060,13 +8047,13 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Asia/Dili */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x92, 0xE6, 0x18, 0xC4, +0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0x92, 0xE6, 0x18, 0xC4, 0xCB, 0x99, 0x32, 0xF0, 0xD2, 0x56, 0xEE, 0x70, 0x0B, 0xEA, 0x30, 0x70, 0x39, 0xC3, 0x99, 0x00, 0x01, 0x02, 0x03, 0x04, 0x03, 0x00, 0x00, 0x75, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4C, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x43, -0x49, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x48, -0x68, 0x01, 0xD2, 0x48, 0x7D, 0x00, 0x00, 0x00, 0x00, +0x80, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4C, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x57, +0x49, 0x54, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, +0x48, 0x68, 0x01, 0xD2, 0x48, 0x7D, 0x00, 0x00, 0x00, 0x00, /* Asia/Dubai */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8122,19 +8109,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x45, 0x12, 0xFD, 0x50, 0x46, 0x0E, 0xD9, 0xE0, 0x46, 0xE8, 0x6F, 0x70, 0x47, 0xEC, 0x18, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xA0, 0x3C, 0x60, 0x4B, 0xAD, 0x2E, 0x9C, 0x4C, 0x61, 0xBD, 0xD0, 0x4D, 0x94, 0xF9, 0x9C, 0x4E, 0x35, 0xC2, 0x50, 0x4F, 0x74, 0xDB, 0x60, -0x50, 0x5B, 0x91, 0xE0, 0x51, 0x54, 0xBD, 0x60, 0x52, 0x44, 0xAE, 0x60, 0x53, 0x34, 0x9F, 0x60, -0x54, 0x24, 0x90, 0x60, 0x55, 0x14, 0x81, 0x60, 0x56, 0x04, 0x72, 0x60, 0x56, 0xFD, 0x9D, 0xE0, -0x57, 0xE4, 0x54, 0x60, 0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xC4, 0x36, 0x60, 0x5A, 0xBD, 0x61, 0xE0, -0x5B, 0xA4, 0x18, 0x60, 0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0x8D, 0x34, 0xE0, 0x5E, 0x7D, 0x25, 0xE0, -0x5F, 0x6D, 0x16, 0xE0, 0x60, 0x5D, 0x07, 0xE0, 0x61, 0x4C, 0xF8, 0xE0, 0x62, 0x46, 0x24, 0x60, -0x63, 0x2C, 0xDA, 0xE0, 0x64, 0x26, 0x06, 0x60, 0x65, 0x0C, 0xBC, 0xE0, 0x66, 0x05, 0xE8, 0x60, -0x66, 0xF5, 0xD9, 0x60, 0x67, 0xE5, 0xCA, 0x60, 0x68, 0xD5, 0xBB, 0x60, 0x69, 0xC5, 0xAC, 0x60, -0x6A, 0xB5, 0x9D, 0x60, 0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0x95, 0x7F, 0x60, 0x6D, 0x8E, 0xAA, 0xE0, -0x6E, 0x75, 0x61, 0x60, 0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x55, 0x43, 0x60, 0x71, 0x4E, 0x6E, 0xE0, -0x72, 0x3E, 0x5F, 0xE0, 0x73, 0x2E, 0x50, 0xE0, 0x74, 0x1E, 0x41, 0xE0, 0x75, 0x0E, 0x32, 0xE0, -0x75, 0xFE, 0x23, 0xE0, 0x76, 0xF7, 0x4F, 0x60, 0x77, 0xDE, 0x05, 0xE0, 0x78, 0xD7, 0x31, 0x60, -0x79, 0xBD, 0xE7, 0xE0, 0x7A, 0xB7, 0x13, 0x60, 0x7B, 0x9D, 0xC9, 0xE0, 0x7C, 0x96, 0xF5, 0x60, -0x7D, 0x86, 0xE6, 0x60, 0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x66, 0xC8, 0x60, 0x00, 0x01, 0x00, 0x01, +0x50, 0x5B, 0x91, 0xE0, 0x51, 0x54, 0xBD, 0x60, 0x52, 0x44, 0xA0, 0x50, 0x53, 0x34, 0x9F, 0x60, +0x54, 0x24, 0x82, 0x50, 0x55, 0x14, 0x81, 0x60, 0x56, 0x04, 0x64, 0x50, 0x56, 0xFD, 0x9D, 0xE0, +0x57, 0xE4, 0x46, 0x50, 0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xC4, 0x28, 0x50, 0x5A, 0xBD, 0x61, 0xE0, +0x5B, 0xA4, 0x0A, 0x50, 0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0x8D, 0x26, 0xD0, 0x5E, 0x7D, 0x25, 0xE0, +0x5F, 0x6D, 0x08, 0xD0, 0x60, 0x5D, 0x07, 0xE0, 0x61, 0x4C, 0xEA, 0xD0, 0x62, 0x46, 0x24, 0x60, +0x63, 0x2C, 0xCC, 0xD0, 0x64, 0x26, 0x06, 0x60, 0x65, 0x0C, 0xAE, 0xD0, 0x66, 0x05, 0xE8, 0x60, +0x66, 0xF5, 0xCB, 0x50, 0x67, 0xE5, 0xCA, 0x60, 0x68, 0xD5, 0xAD, 0x50, 0x69, 0xC5, 0xAC, 0x60, +0x6A, 0xB5, 0x8F, 0x50, 0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0x95, 0x71, 0x50, 0x6D, 0x8E, 0xAA, 0xE0, +0x6E, 0x75, 0x53, 0x50, 0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x55, 0x35, 0x50, 0x71, 0x4E, 0x6E, 0xE0, +0x72, 0x3E, 0x51, 0xD0, 0x73, 0x2E, 0x50, 0xE0, 0x74, 0x1E, 0x33, 0xD0, 0x75, 0x0E, 0x32, 0xE0, +0x75, 0xFE, 0x15, 0xD0, 0x76, 0xF7, 0x4F, 0x60, 0x77, 0xDD, 0xF7, 0xD0, 0x78, 0xD7, 0x31, 0x60, +0x79, 0xBD, 0xD9, 0xD0, 0x7A, 0xB7, 0x13, 0x60, 0x7B, 0x9D, 0xBB, 0xD0, 0x7C, 0x96, 0xF5, 0x60, +0x7D, 0x86, 0xD8, 0x50, 0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x66, 0xBA, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, @@ -8196,19 +8183,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x48, 0xBB, 0x06, 0x50, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xA0, 0x3C, 0x60, 0x4B, 0xAB, 0xDC, 0xE0, 0x4C, 0x61, 0xBD, 0xD0, 0x4D, 0x94, 0xF9, 0x9C, 0x4E, 0x35, 0xC2, 0x50, 0x4E, 0x5C, 0x0B, 0xE0, 0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x5B, 0x91, 0xE0, 0x51, 0x54, 0xBD, 0x60, -0x52, 0x44, 0xAE, 0x60, 0x53, 0x34, 0x9F, 0x60, 0x54, 0x24, 0x90, 0x60, 0x55, 0x14, 0x81, 0x60, -0x56, 0x04, 0x72, 0x60, 0x56, 0xFD, 0x9D, 0xE0, 0x57, 0xE4, 0x54, 0x60, 0x58, 0xDD, 0x7F, 0xE0, -0x59, 0xC4, 0x36, 0x60, 0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xA4, 0x18, 0x60, 0x5C, 0x9D, 0x43, 0xE0, -0x5D, 0x8D, 0x34, 0xE0, 0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x6D, 0x16, 0xE0, 0x60, 0x5D, 0x07, 0xE0, -0x61, 0x4C, 0xF8, 0xE0, 0x62, 0x46, 0x24, 0x60, 0x63, 0x2C, 0xDA, 0xE0, 0x64, 0x26, 0x06, 0x60, -0x65, 0x0C, 0xBC, 0xE0, 0x66, 0x05, 0xE8, 0x60, 0x66, 0xF5, 0xD9, 0x60, 0x67, 0xE5, 0xCA, 0x60, -0x68, 0xD5, 0xBB, 0x60, 0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xB5, 0x9D, 0x60, 0x6B, 0xA5, 0x8E, 0x60, -0x6C, 0x95, 0x7F, 0x60, 0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0x75, 0x61, 0x60, 0x6F, 0x6E, 0x8C, 0xE0, -0x70, 0x55, 0x43, 0x60, 0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x3E, 0x5F, 0xE0, 0x73, 0x2E, 0x50, 0xE0, -0x74, 0x1E, 0x41, 0xE0, 0x75, 0x0E, 0x32, 0xE0, 0x75, 0xFE, 0x23, 0xE0, 0x76, 0xF7, 0x4F, 0x60, -0x77, 0xDE, 0x05, 0xE0, 0x78, 0xD7, 0x31, 0x60, 0x79, 0xBD, 0xE7, 0xE0, 0x7A, 0xB7, 0x13, 0x60, -0x7B, 0x9D, 0xC9, 0xE0, 0x7C, 0x96, 0xF5, 0x60, 0x7D, 0x86, 0xE6, 0x60, 0x7E, 0x76, 0xD7, 0x60, -0x7F, 0x66, 0xC8, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, +0x52, 0x44, 0xA0, 0x50, 0x53, 0x34, 0x9F, 0x60, 0x54, 0x24, 0x82, 0x50, 0x55, 0x14, 0x81, 0x60, +0x56, 0x04, 0x64, 0x50, 0x56, 0xFD, 0x9D, 0xE0, 0x57, 0xE4, 0x46, 0x50, 0x58, 0xDD, 0x7F, 0xE0, +0x59, 0xC4, 0x28, 0x50, 0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xA4, 0x0A, 0x50, 0x5C, 0x9D, 0x43, 0xE0, +0x5D, 0x8D, 0x26, 0xD0, 0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x6D, 0x08, 0xD0, 0x60, 0x5D, 0x07, 0xE0, +0x61, 0x4C, 0xEA, 0xD0, 0x62, 0x46, 0x24, 0x60, 0x63, 0x2C, 0xCC, 0xD0, 0x64, 0x26, 0x06, 0x60, +0x65, 0x0C, 0xAE, 0xD0, 0x66, 0x05, 0xE8, 0x60, 0x66, 0xF5, 0xCB, 0x50, 0x67, 0xE5, 0xCA, 0x60, +0x68, 0xD5, 0xAD, 0x50, 0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xB5, 0x8F, 0x50, 0x6B, 0xA5, 0x8E, 0x60, +0x6C, 0x95, 0x71, 0x50, 0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0x75, 0x53, 0x50, 0x6F, 0x6E, 0x8C, 0xE0, +0x70, 0x55, 0x35, 0x50, 0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x3E, 0x51, 0xD0, 0x73, 0x2E, 0x50, 0xE0, +0x74, 0x1E, 0x33, 0xD0, 0x75, 0x0E, 0x32, 0xE0, 0x75, 0xFE, 0x15, 0xD0, 0x76, 0xF7, 0x4F, 0x60, +0x77, 0xDD, 0xF7, 0xD0, 0x78, 0xD7, 0x31, 0x60, 0x79, 0xBD, 0xD9, 0xD0, 0x7A, 0xB7, 0x13, 0x60, +0x7B, 0x9D, 0xBB, 0xD0, 0x7C, 0x96, 0xF5, 0x60, 0x7D, 0x86, 0xD8, 0x50, 0x7E, 0x76, 0xD7, 0x60, +0x7F, 0x66, 0xBA, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, @@ -8397,7 +8384,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0xDA, 0xFF, 0x26, 0x00, 0xF4, 0xB5, 0xBE, 0x88, 0x01, 0x02, 0x03, 0x02, 0x04, 0x02, 0x05, 0x00, 0x00, 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x00, 0x00, 0x62, -0x70, 0x00, 0x09, 0x4A, 0x4D, 0x54, 0x00, 0x4A, 0x41, 0x56, 0x54, 0x00, 0x57, 0x49, 0x54, 0x00, +0x70, 0x00, 0x09, 0x42, 0x4D, 0x54, 0x00, 0x4A, 0x41, 0x56, 0x54, 0x00, 0x57, 0x49, 0x42, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xEB, 0x65, 0x01, 0xB5, 0x9F, 0x40, 0x00, 0x00, 0x00, 0x0E, 0x4A, 0x61, 0x76, 0x61, 0x20, 0x26, 0x20, 0x53, 0x75, 0x6D, 0x61, 0x74, 0x72, 0x61, @@ -8408,7 +8395,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xBA, 0x16, 0xC1, 0x98, 0xD0, 0x58, 0xB9, 0xF0, 0xF4, 0xB5, 0xA2, 0x68, 0x01, 0x02, 0x01, 0x00, 0x00, 0x83, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x49, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x57, 0x49, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x76, 0xAA, 0x01, 0xE9, 0x59, 0x70, 0x00, 0x00, 0x00, 0x31, 0x77, 0x65, 0x73, 0x74, 0x20, 0x4E, 0x65, 0x77, 0x20, 0x47, 0x75, 0x69, 0x6E, 0x65, 0x61, 0x20, 0x28, 0x49, 0x72, 0x69, 0x61, 0x6E, 0x20, 0x4A, 0x61, 0x79, 0x61, 0x29, 0x20, 0x26, 0x20, 0x4D, 0x61, 0x6C, 0x75, 0x6B, 0x75, @@ -8441,19 +8428,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, 0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x50, 0x99, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x30, 0x7B, 0xF0, 0x55, 0x14, 0x9D, 0x80, -0x56, 0x10, 0x5D, 0xF0, 0x56, 0xF4, 0x7F, 0x80, 0x57, 0xF0, 0x3F, 0xF0, 0x58, 0xD4, 0x61, 0x80, -0x59, 0xD9, 0x5C, 0x70, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xB9, 0x3E, 0x70, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x79, 0x02, 0x70, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x58, 0xE4, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x1C, 0xE8, 0x00, -0x65, 0x21, 0xE2, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xE1, 0xA6, 0xF0, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0x8A, 0x87, 0x70, 0x6F, 0x65, 0x6E, 0x80, -0x70, 0x6A, 0x69, 0x70, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x2A, 0x2D, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x0A, 0x0F, 0x70, 0x76, 0xEE, 0x31, 0x00, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xD3, 0x0D, 0xF0, 0x7A, 0xAD, 0xF5, 0x00, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x92, 0xD1, 0xF0, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x72, 0xB3, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, +0x52, 0x6C, 0x49, 0x70, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x14, 0x9D, 0x80, +0x56, 0x2C, 0x0D, 0x70, 0x56, 0xF4, 0x7F, 0x80, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD4, 0x61, 0x80, +0x59, 0xF5, 0x0B, 0xF0, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9D, 0x60, 0x00, +0x5D, 0xB4, 0xCF, 0xF0, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5D, 0x24, 0x00, +0x61, 0x7D, 0xCE, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1C, 0xE8, 0x00, +0x65, 0x3D, 0x92, 0x70, 0x66, 0x06, 0x04, 0x80, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE5, 0xE6, 0x80, +0x68, 0xFD, 0x56, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA5, 0xAA, 0x80, +0x6C, 0xC6, 0x54, 0xF0, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x65, 0x6E, 0x80, +0x70, 0x86, 0x18, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x2E, 0x6D, 0x00, +0x74, 0x45, 0xDC, 0xF0, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xEE, 0x31, 0x00, +0x78, 0x0E, 0xDB, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xAD, 0xF5, 0x00, +0x7B, 0xCE, 0x9F, 0x70, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x76, 0xF3, 0x80, +0x7F, 0x8E, 0x63, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 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, @@ -8465,7 +8452,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB9, 0xCD, 0x1A, 0x01, 0x48, 0x6B, 0x85, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xB9, 0xD2, 0x87, 0x01, 0x48, 0x67, 0xD4, 0x00, 0x00, 0x00, 0x00, /* Asia/Kabul */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8754,17 +8741,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Asia/Makassar */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 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, 0x10, 0xA1, 0xF2, 0x5D, 0x90, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0x5D, 0x90, 0xBA, 0x16, 0xD5, 0x90, 0xCB, 0x88, 0x1D, 0x80, 0xD2, 0x56, 0xEE, 0x70, 0x01, 0x02, 0x03, 0x02, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, -0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, -0x43, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x81, 0x85, 0x8D, 0x01, 0xC8, 0xD9, 0x1F, 0x00, 0x00, 0x00, 0x48, 0x65, 0x61, 0x73, 0x74, -0x20, 0x26, 0x20, 0x73, 0x6F, 0x75, 0x74, 0x68, 0x20, 0x42, 0x6F, 0x72, 0x6E, 0x65, 0x6F, 0x2C, -0x20, 0x53, 0x75, 0x6C, 0x61, 0x77, 0x65, 0x73, 0x69, 0x20, 0x28, 0x43, 0x65, 0x6C, 0x65, 0x62, -0x65, 0x73, 0x29, 0x2C, 0x20, 0x42, 0x61, 0x6C, 0x69, 0x2C, 0x20, 0x4E, 0x75, 0x73, 0x61, 0x20, -0x54, 0x65, 0x6E, 0x67, 0x61, 0x72, 0x72, 0x61, 0x2C, 0x20, 0x77, 0x65, 0x73, 0x74, 0x20, 0x54, -0x69, 0x6D, 0x6F, 0x72, +0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, +0x57, 0x49, 0x54, 0x41, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x81, 0x85, 0x8D, 0x01, 0xC8, 0xD9, 0x1F, 0x00, 0x00, 0x00, 0x48, 0x65, 0x61, 0x73, +0x74, 0x20, 0x26, 0x20, 0x73, 0x6F, 0x75, 0x74, 0x68, 0x20, 0x42, 0x6F, 0x72, 0x6E, 0x65, 0x6F, +0x2C, 0x20, 0x53, 0x75, 0x6C, 0x61, 0x77, 0x65, 0x73, 0x69, 0x20, 0x28, 0x43, 0x65, 0x6C, 0x65, +0x62, 0x65, 0x73, 0x29, 0x2C, 0x20, 0x42, 0x61, 0x6C, 0x69, 0x2C, 0x20, 0x4E, 0x75, 0x73, 0x61, +0x20, 0x54, 0x65, 0x6E, 0x67, 0x61, 0x72, 0x72, 0x61, 0x2C, 0x20, 0x77, 0x65, 0x73, 0x74, 0x20, +0x54, 0x69, 0x6D, 0x6F, 0x72, /* Asia/Manila */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8980,17 +8967,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Asia/Pontianak */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x8B, 0xFF, 0x8E, 0x00, +0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x8B, 0xFF, 0x8E, 0x00, 0xBA, 0x16, 0xDF, 0x00, 0xCB, 0x79, 0xA4, 0x08, 0xD2, 0x56, 0xEE, 0x70, 0xD7, 0x3C, 0xC6, 0x08, 0xDA, 0xFF, 0x26, 0x00, 0xF4, 0xB5, 0xBE, 0x88, 0x21, 0xDA, 0x74, 0x80, 0x01, 0x02, 0x03, 0x02, 0x04, 0x02, 0x05, 0x06, 0x00, 0x00, 0x66, 0x80, 0x00, 0x00, 0x00, 0x00, 0x66, 0x80, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x10, 0x00, 0x00, 0x62, 0x70, 0x00, 0x08, 0x4C, 0x4D, -0x54, 0x00, 0x50, 0x4D, 0x54, 0x00, 0x57, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x43, 0x49, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x89, 0x47, 0x3A, 0x01, 0xB9, 0x7C, 0xD5, 0x00, 0x00, 0x00, 0x15, 0x77, 0x65, 0x73, 0x74, -0x20, 0x26, 0x20, 0x63, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x42, 0x6F, 0x72, 0x6E, 0x65, -0x6F, +0x54, 0x00, 0x50, 0x4D, 0x54, 0x00, 0x57, 0x49, 0x42, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x57, 0x49, +0x54, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x89, 0x47, 0x3A, 0x01, 0xB9, 0x7C, 0xD5, 0x00, 0x00, 0x00, 0x15, 0x77, 0x65, 0x73, +0x74, 0x20, 0x26, 0x20, 0x63, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x42, 0x6F, 0x72, 0x6E, +0x65, 0x6F, /* Asia/Pyongyang */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9310,19 +9297,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, 0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x50, 0x99, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x30, 0x7B, 0xF0, 0x55, 0x14, 0x9D, 0x80, -0x56, 0x10, 0x5D, 0xF0, 0x56, 0xF4, 0x7F, 0x80, 0x57, 0xF0, 0x3F, 0xF0, 0x58, 0xD4, 0x61, 0x80, -0x59, 0xD9, 0x5C, 0x70, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xB9, 0x3E, 0x70, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x79, 0x02, 0x70, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x58, 0xE4, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x1C, 0xE8, 0x00, -0x65, 0x21, 0xE2, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xE1, 0xA6, 0xF0, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0x8A, 0x87, 0x70, 0x6F, 0x65, 0x6E, 0x80, -0x70, 0x6A, 0x69, 0x70, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x2A, 0x2D, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x0A, 0x0F, 0x70, 0x76, 0xEE, 0x31, 0x00, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xD3, 0x0D, 0xF0, 0x7A, 0xAD, 0xF5, 0x00, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x92, 0xD1, 0xF0, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x72, 0xB3, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, +0x52, 0x6C, 0x49, 0x70, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x14, 0x9D, 0x80, +0x56, 0x2C, 0x0D, 0x70, 0x56, 0xF4, 0x7F, 0x80, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD4, 0x61, 0x80, +0x59, 0xF5, 0x0B, 0xF0, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9D, 0x60, 0x00, +0x5D, 0xB4, 0xCF, 0xF0, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5D, 0x24, 0x00, +0x61, 0x7D, 0xCE, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1C, 0xE8, 0x00, +0x65, 0x3D, 0x92, 0x70, 0x66, 0x06, 0x04, 0x80, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE5, 0xE6, 0x80, +0x68, 0xFD, 0x56, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA5, 0xAA, 0x80, +0x6C, 0xC6, 0x54, 0xF0, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x65, 0x6E, 0x80, +0x70, 0x86, 0x18, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x2E, 0x6D, 0x00, +0x74, 0x45, 0xDC, 0xF0, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xEE, 0x31, 0x00, +0x78, 0x0E, 0xDB, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xAD, 0xF5, 0x00, +0x7B, 0xCE, 0x9F, 0x70, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x76, 0xF3, 0x80, +0x7F, 0x8E, 0x63, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 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, @@ -9368,12 +9355,12 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Asia/Ujung_Pandang */ 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, 0x10, 0xA1, 0xF2, 0x5D, 0x90, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0x5D, 0x90, 0xBA, 0x16, 0xD5, 0x90, 0xCB, 0x88, 0x1D, 0x80, 0xD2, 0x56, 0xEE, 0x70, 0x01, 0x02, 0x03, 0x02, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, -0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, -0x43, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, +0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, +0x57, 0x49, 0x54, 0x41, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, /* Asia/Ulaanbaatar */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15346,8 +15333,9 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Europe/Vaduz */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x49, 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, 0x72, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x15, 0x23, 0xEB, 0x90, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x17, 0x6A, 0x00, +0xCA, 0xE2, 0x71, 0x00, 0xCB, 0xF7, 0x4C, 0x00, 0xCC, 0xC2, 0x53, 0x00, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, @@ -15376,17 +15364,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 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, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0xD1, 0x46, 0x38, 0x01, 0x21, 0x2D, 0xF2, 0x00, -0x00, 0x00, 0x00, +0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, +0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, +0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, +0x00, 0x01, 0x01, 0x00, 0xD1, 0x46, 0x38, 0x01, 0x21, 0x2D, 0xF2, 0x00, 0x00, 0x00, 0x00, /* Europe/Vatican */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16249,19 +16237,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, 0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x50, 0x99, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x30, 0x7B, 0xF0, 0x55, 0x14, 0x9D, 0x80, -0x56, 0x10, 0x5D, 0xF0, 0x56, 0xF4, 0x7F, 0x80, 0x57, 0xF0, 0x3F, 0xF0, 0x58, 0xD4, 0x61, 0x80, -0x59, 0xD9, 0x5C, 0x70, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xB9, 0x3E, 0x70, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x79, 0x02, 0x70, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x58, 0xE4, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x1C, 0xE8, 0x00, -0x65, 0x21, 0xE2, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xE1, 0xA6, 0xF0, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0x8A, 0x87, 0x70, 0x6F, 0x65, 0x6E, 0x80, -0x70, 0x6A, 0x69, 0x70, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x2A, 0x2D, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x0A, 0x0F, 0x70, 0x76, 0xEE, 0x31, 0x00, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xD3, 0x0D, 0xF0, 0x7A, 0xAD, 0xF5, 0x00, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x92, 0xD1, 0xF0, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x72, 0xB3, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, +0x52, 0x6C, 0x49, 0x70, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x14, 0x9D, 0x80, +0x56, 0x2C, 0x0D, 0x70, 0x56, 0xF4, 0x7F, 0x80, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD4, 0x61, 0x80, +0x59, 0xF5, 0x0B, 0xF0, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9D, 0x60, 0x00, +0x5D, 0xB4, 0xCF, 0xF0, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5D, 0x24, 0x00, +0x61, 0x7D, 0xCE, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1C, 0xE8, 0x00, +0x65, 0x3D, 0x92, 0x70, 0x66, 0x06, 0x04, 0x80, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE5, 0xE6, 0x80, +0x68, 0xFD, 0x56, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA5, 0xAA, 0x80, +0x6C, 0xC6, 0x54, 0xF0, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x65, 0x6E, 0x80, +0x70, 0x86, 0x18, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x2E, 0x6D, 0x00, +0x74, 0x45, 0xDC, 0xF0, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xEE, 0x31, 0x00, +0x78, 0x0E, 0xDB, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xAD, 0xF5, 0x00, +0x7B, 0xCE, 0x9F, 0x70, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x76, 0xF3, 0x80, +0x7F, 0x8E, 0x63, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 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, @@ -16278,14 +16266,14 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Jamaica */ 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, 0xB5, 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, 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, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, +0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, @@ -16999,19 +16987,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 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, 0x62, 0x90, 0x60, 0x52, 0xDA, 0x88, 0xE0, 0x54, 0x42, 0x72, 0x60, 0x54, 0xBA, 0x6A, 0xE0, -0x56, 0x22, 0x54, 0x60, 0x56, 0xA3, 0x87, 0x60, 0x58, 0x0B, 0x70, 0xE0, 0x58, 0x83, 0x69, 0x60, +0x52, 0x6B, 0xCA, 0xE0, 0x52, 0xDA, 0x88, 0xE0, 0x54, 0x4B, 0xAC, 0xE0, 0x54, 0xBA, 0x6A, 0xE0, +0x56, 0x2B, 0x8E, 0xE0, 0x56, 0xA3, 0x87, 0x60, 0x58, 0x0B, 0x70, 0xE0, 0x58, 0x83, 0x69, 0x60, 0x59, 0xEB, 0x52, 0xE0, 0x5A, 0x63, 0x4B, 0x60, 0x5B, 0xCB, 0x34, 0xE0, 0x5C, 0x43, 0x2D, 0x60, -0x5D, 0xAB, 0x16, 0xE0, 0x5E, 0x23, 0x0F, 0x60, 0x5F, 0x8A, 0xF8, 0xE0, 0x60, 0x0C, 0x2B, 0xE0, +0x5D, 0xB4, 0x51, 0x60, 0x5E, 0x23, 0x0F, 0x60, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x0C, 0x2B, 0xE0, 0x61, 0x74, 0x15, 0x60, 0x61, 0xEC, 0x0D, 0xE0, 0x63, 0x53, 0xF7, 0x60, 0x63, 0xCB, 0xEF, 0xE0, -0x65, 0x33, 0xD9, 0x60, 0x65, 0xAB, 0xD1, 0xE0, 0x67, 0x13, 0xBB, 0x60, 0x67, 0x8B, 0xB3, 0xE0, -0x68, 0xF3, 0x9D, 0x60, 0x69, 0x6B, 0x95, 0xE0, 0x6A, 0xD3, 0x7F, 0x60, 0x6B, 0x54, 0xB2, 0x60, +0x65, 0x33, 0xD9, 0x60, 0x65, 0xAB, 0xD1, 0xE0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0x8B, 0xB3, 0xE0, +0x68, 0xFC, 0xD7, 0xE0, 0x69, 0x6B, 0x95, 0xE0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0x54, 0xB2, 0x60, 0x6C, 0xBC, 0x9B, 0xE0, 0x6D, 0x34, 0x94, 0x60, 0x6E, 0x9C, 0x7D, 0xE0, 0x6F, 0x14, 0x76, 0x60, -0x70, 0x7C, 0x5F, 0xE0, 0x70, 0xF4, 0x58, 0x60, 0x72, 0x5C, 0x41, 0xE0, 0x72, 0xD4, 0x3A, 0x60, -0x74, 0x3C, 0x23, 0xE0, 0x74, 0xB4, 0x1C, 0x60, 0x76, 0x25, 0x40, 0x60, 0x76, 0x9D, 0x38, 0xE0, +0x70, 0x7C, 0x5F, 0xE0, 0x70, 0xF4, 0x58, 0x60, 0x72, 0x65, 0x7C, 0x60, 0x72, 0xD4, 0x3A, 0x60, +0x74, 0x45, 0x5E, 0x60, 0x74, 0xB4, 0x1C, 0x60, 0x76, 0x25, 0x40, 0x60, 0x76, 0x9D, 0x38, 0xE0, 0x78, 0x05, 0x22, 0x60, 0x78, 0x7D, 0x1A, 0xE0, 0x79, 0xE5, 0x04, 0x60, 0x7A, 0x5C, 0xFC, 0xE0, -0x7B, 0xC4, 0xE6, 0x60, 0x7C, 0x3C, 0xDE, 0xE0, 0x7D, 0xA4, 0xC8, 0x60, 0x7E, 0x1C, 0xC0, 0xE0, -0x7F, 0x84, 0xAA, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x7B, 0xC4, 0xE6, 0x60, 0x7C, 0x3C, 0xDE, 0xE0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x1C, 0xC0, 0xE0, +0x7F, 0x8D, 0xE4, 0xE0, 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, @@ -17074,11 +17062,13 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Pacific/Johnston */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x4D, 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, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0xA2, 0xE3, 0x38, 0x00, 0x0F, 0xFF, 0x0D, -0x00, 0x00, 0x00, 0x0E, 0x4A, 0x6F, 0x68, 0x6E, 0x73, 0x74, 0x6F, 0x6E, 0x20, 0x41, 0x74, 0x6F, -0x6C, 0x6C, +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, 0x08, 0xBB, 0x05, 0x43, 0x48, +0xBB, 0x21, 0x71, 0x58, 0xCB, 0x89, 0x3D, 0xC8, 0xD2, 0x61, 0x49, 0x38, 0xD5, 0x8D, 0x73, 0x48, +0x01, 0x00, 0x01, 0x00, 0x02, 0xFF, 0xFF, 0x6C, 0x58, 0x00, 0x00, 0xFF, 0xFF, 0x7A, 0x68, 0x01, +0x04, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x48, 0x44, 0x54, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2, 0xE3, 0x38, 0x00, 0x0F, 0xFF, 0x0D, 0x00, 0x00, 0x00, +0x0E, 0x4A, 0x6F, 0x68, 0x6E, 0x73, 0x74, 0x6F, 0x6E, 0x20, 0x41, 0x74, 0x6F, 0x6C, 0x6C, /* Pacific/Kiritimati */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -18410,4 +18400,4 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 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 = { "2013.3", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2013.6", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 04f28aac6..70960b161 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -39,6 +39,20 @@ static __inline __int64_t php_date_llabs( __int64_t i ) { return i >= 0 ? i : -i static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i; } #endif +#ifdef PHP_WIN32 +#define DATE_I64_BUF_LEN 65 +# define DATE_I64A(i, s, len) _i64toa_s(i, s, len, 10) +# define DATE_A64I(i, s) i = _atoi64(s) +#else +#define DATE_I64_BUF_LEN 65 +# define DATE_I64A(i, s, len) \ + do { \ + int st = snprintf(s, len, "%lld", i); \ + s[st] = '\0'; \ + } while (0); +# define DATE_A64I(i, s) i = atoll(s) +#endif + /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1) ZEND_ARG_INFO(0, format) @@ -472,6 +486,8 @@ const zend_function_entry date_funcs_interval[] = { const zend_function_entry date_funcs_period[] = { PHP_ME(DatePeriod, __construct, arginfo_date_period_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(DatePeriod, __wakeup, NULL, ZEND_ACC_PUBLIC) + PHP_ME(DatePeriod, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END }; @@ -569,9 +585,13 @@ static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_ static HashTable *date_object_get_properties(zval *object TSRMLS_DC); static HashTable *date_object_get_gc_interval(zval *object, zval ***table, int *n TSRMLS_DC); static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC); +static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC); +static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC); zval *date_interval_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC); void date_interval_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC); +static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC); +static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC); /* {{{ Module struct */ zend_module_entry date_module_entry = { @@ -977,7 +997,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d) static char *date_format(char *format, int format_len, timelib_time *t, int localtime) { smart_str string = {0}; - int i, length; + int i, length = 0; char buffer[97]; timelib_time_offset *offset = NULL; timelib_sll isoweek, isoyear; @@ -1332,7 +1352,7 @@ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb) } /* }}} */ -/* {{{ php_parse_date: Backwards compability function */ +/* {{{ php_parse_date: Backwards compatibility function */ PHPAPI signed long php_parse_date(char *string, signed long *now) { timelib_time *parsed_time; @@ -1982,6 +2002,11 @@ static void date_register_classes(TSRMLS_D) zend_class_implements(date_ce_period TSRMLS_CC, 1, zend_ce_traversable); memcpy(&date_object_handlers_period, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); date_object_handlers_period.clone_obj = date_object_clone_period; + date_object_handlers_period.get_properties = date_object_get_properties_period; + date_object_handlers_period.get_property_ptr_ptr = NULL; + date_object_handlers_period.get_gc = date_object_get_gc_period; + date_object_handlers_period.read_property = date_period_read_property; + date_object_handlers_period.write_property = date_period_write_property; #define REGISTER_PERIOD_CLASS_CONST_STRING(const_name, value) \ zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value TSRMLS_CC); @@ -2081,20 +2106,20 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) props = zend_std_get_properties(object TSRMLS_CC); - if (!dateobj->time) { + if (!dateobj->time || GC_G(gc_active)) { return props; } /* first we add the date and time in ISO format */ MAKE_STD_ZVAL(zv); ZVAL_STRING(zv, date_format("Y-m-d H:i:s", 12, dateobj->time, 1), 0); - zend_hash_update(props, "date", 5, &zv, sizeof(zval), NULL); + zend_hash_update(props, "date", 5, &zv, sizeof(zv), NULL); /* then we add the timezone name (or similar) */ if (dateobj->time->is_localtime) { MAKE_STD_ZVAL(zv); ZVAL_LONG(zv, dateobj->time->zone_type); - zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zval), NULL); + zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zv), NULL); MAKE_STD_ZVAL(zv); switch (dateobj->time->zone_type) { @@ -2117,7 +2142,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) ZVAL_STRING(zv, dateobj->time->tz_abbr, 1); break; } - zend_hash_update(props, "timezone", 9, &zv, sizeof(zval), NULL); + zend_hash_update(props, "timezone", 9, &zv, sizeof(zv), NULL); } return props; @@ -2229,7 +2254,6 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) zval *zv; php_interval_obj *intervalobj; - intervalobj = (php_interval_obj *) zend_object_store_get_object(object TSRMLS_CC); props = zend_std_get_properties(object TSRMLS_CC); @@ -2240,8 +2264,8 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) #define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \ MAKE_STD_ZVAL(zv); \ - ZVAL_LONG(zv, intervalobj->diff->f); \ - zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL); + ZVAL_LONG(zv, (long)intervalobj->diff->f); \ + zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zv), NULL); PHP_DATE_INTERVAL_ADD_PROPERTY("y", y); PHP_DATE_INTERVAL_ADD_PROPERTY("m", m); @@ -2249,14 +2273,21 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) PHP_DATE_INTERVAL_ADD_PROPERTY("h", h); PHP_DATE_INTERVAL_ADD_PROPERTY("i", i); PHP_DATE_INTERVAL_ADD_PROPERTY("s", s); + PHP_DATE_INTERVAL_ADD_PROPERTY("weekday", weekday); + PHP_DATE_INTERVAL_ADD_PROPERTY("weekday_behavior", weekday_behavior); + PHP_DATE_INTERVAL_ADD_PROPERTY("first_last_day_of", first_last_day_of); PHP_DATE_INTERVAL_ADD_PROPERTY("invert", invert); if (intervalobj->diff->days != -99999) { PHP_DATE_INTERVAL_ADD_PROPERTY("days", days); } else { MAKE_STD_ZVAL(zv); ZVAL_FALSE(zv); - zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL); + zend_hash_update(props, "days", 5, &zv, sizeof(zv), NULL); } + PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type); + PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount); + PHP_DATE_INTERVAL_ADD_PROPERTY("have_weekday_relative", have_weekday_relative); + PHP_DATE_INTERVAL_ADD_PROPERTY("have_special_relative", have_special_relative); return props; } @@ -2358,6 +2389,7 @@ PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) object_init_ex(object, pce); Z_SET_REFCOUNT_P(object, 1); Z_UNSET_ISREF_P(object); + return object; } @@ -2377,8 +2409,8 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, timelib_time *now; timelib_tzinfo *tzi = NULL; timelib_error_container *err = NULL; - int type = TIMELIB_ZONETYPE_ID, new_dst; - char *new_abbr; + int type = TIMELIB_ZONETYPE_ID, new_dst = 0; + char *new_abbr = NULL; timelib_sll new_offset; if (dateobj->time) { @@ -3536,7 +3568,11 @@ zval *date_interval_read_property(zval *object, zval *member, int type, const ze ALLOC_INIT_ZVAL(retval); Z_SET_REFCOUNT_P(retval, 0); - ZVAL_LONG(retval, value); + if (value != -99999) { + ZVAL_LONG(retval, value); + } else { + ZVAL_FALSE(retval); + } if (member == &tmp_member) { zval_dtor(member); @@ -3629,30 +3665,48 @@ PHP_METHOD(DateInterval, __construct) } /* }}} */ -static long php_date_long_from_hash_element(HashTable *myht, char *element, size_t size) -{ - zval **z_arg = NULL; - - if (zend_hash_find(myht, element, size + 1, (void**) &z_arg) == SUCCESS) { - convert_to_long(*z_arg); - return Z_LVAL_PP(z_arg); - } else { - return -1; - } -} static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht TSRMLS_DC) { (*intobj)->diff = timelib_rel_time_ctor(); - (*intobj)->diff->y = php_date_long_from_hash_element(myht, "y", 1); - (*intobj)->diff->m = php_date_long_from_hash_element(myht, "m", 1); - (*intobj)->diff->d = php_date_long_from_hash_element(myht, "d", 1); - (*intobj)->diff->h = php_date_long_from_hash_element(myht, "h", 1); - (*intobj)->diff->i = php_date_long_from_hash_element(myht, "i", 1); - (*intobj)->diff->s = php_date_long_from_hash_element(myht, "s", 1); - (*intobj)->diff->invert = php_date_long_from_hash_element(myht, "invert", 6); - (*intobj)->diff->days = php_date_long_from_hash_element(myht, "days", 4); +#define PHP_DATE_INTERVAL_READ_PROPERTY(element, member, itype, def) \ + do { \ + zval **z_arg = NULL; \ + if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \ + convert_to_long(*z_arg); \ + (*intobj)->diff->member = (itype)Z_LVAL_PP(z_arg); \ + } else { \ + (*intobj)->diff->member = (itype)def; \ + } \ + } while (0); + +#define PHP_DATE_INTERVAL_READ_PROPERTY_I64(element, member) \ + do { \ + zval **z_arg = NULL; \ + if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \ + convert_to_string(*z_arg); \ + DATE_A64I((*intobj)->diff->member, Z_STRVAL_PP(z_arg)); \ + } else { \ + (*intobj)->diff->member = -1LL; \ + } \ + } while (0); + + PHP_DATE_INTERVAL_READ_PROPERTY("y", y, timelib_sll, -1) + PHP_DATE_INTERVAL_READ_PROPERTY("m", m, timelib_sll, -1) + PHP_DATE_INTERVAL_READ_PROPERTY("d", d, timelib_sll, -1) + PHP_DATE_INTERVAL_READ_PROPERTY("h", h, timelib_sll, -1) + PHP_DATE_INTERVAL_READ_PROPERTY("i", i, timelib_sll, -1) + PHP_DATE_INTERVAL_READ_PROPERTY("s", s, timelib_sll, -1) + PHP_DATE_INTERVAL_READ_PROPERTY("weekday", weekday, int, -1) + PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1) + PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1) + PHP_DATE_INTERVAL_READ_PROPERTY("invert", invert, int, 0); + PHP_DATE_INTERVAL_READ_PROPERTY_I64("days", days); + PHP_DATE_INTERVAL_READ_PROPERTY("special_type", special.type, unsigned int, 0); + PHP_DATE_INTERVAL_READ_PROPERTY_I64("special_amount", special.amount); + PHP_DATE_INTERVAL_READ_PROPERTY("have_weekday_relative", have_weekday_relative, unsigned int, 0); + PHP_DATE_INTERVAL_READ_PROPERTY("have_special_relative", have_special_relative, unsigned int, 0); (*intobj)->initialized = 1; return 0; @@ -4256,6 +4310,229 @@ PHP_FUNCTION(date_sun_info) timelib_time_dtor(t2); } /* }}} */ + +static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object TSRMLS_CC); +} + +static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) +{ + HashTable *props; + zval *zv; + php_period_obj *period_obj; + + period_obj = zend_object_store_get_object(object TSRMLS_CC); + + props = zend_std_get_properties(object TSRMLS_CC); + + if (!period_obj->start || GC_G(gc_active)) { + return props; + } + + MAKE_STD_ZVAL(zv); + if (period_obj->start) { + php_date_obj *date_obj; + object_init_ex(zv, date_ce_date); + date_obj = zend_object_store_get_object(zv TSRMLS_CC); + date_obj->time = timelib_time_clone(period_obj->start); + } else { + ZVAL_NULL(zv); + } + zend_hash_update(props, "start", sizeof("start"), &zv, sizeof(zv), NULL); + + MAKE_STD_ZVAL(zv); + if (period_obj->current) { + php_date_obj *date_obj; + object_init_ex(zv, date_ce_date); + date_obj = zend_object_store_get_object(zv TSRMLS_CC); + date_obj->time = timelib_time_clone(period_obj->current); + } else { + ZVAL_NULL(zv); + } + zend_hash_update(props, "current", sizeof("current"), &zv, sizeof(zv), NULL); + + MAKE_STD_ZVAL(zv); + if (period_obj->end) { + php_date_obj *date_obj; + object_init_ex(zv, date_ce_date); + date_obj = zend_object_store_get_object(zv TSRMLS_CC); + date_obj->time = timelib_time_clone(period_obj->end); + } else { + ZVAL_NULL(zv); + } + zend_hash_update(props, "end", sizeof("end"), &zv, sizeof(zv), NULL); + + MAKE_STD_ZVAL(zv); + if (period_obj->interval) { + php_interval_obj *interval_obj; + object_init_ex(zv, date_ce_interval); + interval_obj = zend_object_store_get_object(zv TSRMLS_CC); + interval_obj->diff = timelib_rel_time_clone(period_obj->interval); + interval_obj->initialized = 1; + } else { + ZVAL_NULL(zv); + } + zend_hash_update(props, "interval", sizeof("interval"), &zv, sizeof(zv), NULL); + + /* converted to larger type (int->long); must check when unserializing */ + MAKE_STD_ZVAL(zv); + ZVAL_LONG(zv, (long) period_obj->recurrences); + zend_hash_update(props, "recurrences", sizeof("recurrences"), &zv, sizeof(zv), NULL); + + MAKE_STD_ZVAL(zv); + ZVAL_BOOL(zv, period_obj->include_start_date); + zend_hash_update(props, "include_start_date", sizeof("include_start_date"), &zv, sizeof(zv), NULL); + + return props; +} + +static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht TSRMLS_DC) +{ + zval **ht_entry; + + /* this function does no rollback on error */ + + if (zend_hash_find(myht, "start", sizeof("start"), (void**) &ht_entry) == SUCCESS) { + if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) { + php_date_obj *date_obj; + date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC); + period_obj->start = timelib_time_clone(date_obj->time); + } else if (Z_TYPE_PP(ht_entry) != IS_NULL) { + return 0; + } + } else { + return 0; + } + + if (zend_hash_find(myht, "end", sizeof("end"), (void**) &ht_entry) == SUCCESS) { + if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) { + php_date_obj *date_obj; + date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC); + period_obj->end = timelib_time_clone(date_obj->time); + } else if (Z_TYPE_PP(ht_entry) != IS_NULL) { + return 0; + } + } else { + return 0; + } + + if (zend_hash_find(myht, "current", sizeof("current"), (void**) &ht_entry) == SUCCESS) { + if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) { + php_date_obj *date_obj; + date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC); + period_obj->current = timelib_time_clone(date_obj->time); + } else if (Z_TYPE_PP(ht_entry) != IS_NULL) { + return 0; + } + } else { + return 0; + } + + if (zend_hash_find(myht, "interval", sizeof("interval"), (void**) &ht_entry) == SUCCESS) { + if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_interval) { + php_interval_obj *interval_obj; + interval_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC); + period_obj->interval = timelib_rel_time_clone(interval_obj->diff); + } else { /* interval is required */ + return 0; + } + } else { + return 0; + } + + if (zend_hash_find(myht, "recurrences", sizeof("recurrences"), (void**) &ht_entry) == SUCCESS && + Z_TYPE_PP(ht_entry) == IS_LONG && Z_LVAL_PP(ht_entry) >= 0 && Z_LVAL_PP(ht_entry) <= INT_MAX) { + period_obj->recurrences = Z_LVAL_PP(ht_entry); + } else { + return 0; + } + + if (zend_hash_find(myht, "include_start_date", sizeof("include_start_date"), (void**) &ht_entry) == SUCCESS && + Z_TYPE_PP(ht_entry) == IS_BOOL) { + period_obj->include_start_date = Z_BVAL_PP(ht_entry); + } else { + return 0; + } + + period_obj->initialized = 1; + + return 1; +} + +/* {{{ proto DatePeriod::__set_state() +*/ +PHP_METHOD(DatePeriod, __set_state) +{ + php_period_obj *period_obj; + zval *array; + HashTable *myht; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { + RETURN_FALSE; + } + + myht = Z_ARRVAL_P(array); + + object_init_ex(return_value, date_ce_period); + period_obj = zend_object_store_get_object(return_value TSRMLS_CC); + if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) { + php_error(E_ERROR, "Invalid serialization data for DatePeriod object"); + } +} +/* }}} */ + +/* {{{ proto DatePeriod::__wakeup() +*/ +PHP_METHOD(DatePeriod, __wakeup) +{ + zval *object = getThis(); + php_period_obj *period_obj; + HashTable *myht; + + period_obj = zend_object_store_get_object(object TSRMLS_CC); + + myht = Z_OBJPROP_P(object); + + if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) { + php_error(E_ERROR, "Invalid serialization data for DatePeriod object"); + } +} +/* }}} */ + +/* {{{ date_period_read_property */ +static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) +{ + zval *zv; + if (type != BP_VAR_IS && type != BP_VAR_R) { + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported"); + } + + Z_OBJPROP_P(object); /* build properties hash table */ + + zv = std_object_handlers.read_property(object, member, type, key TSRMLS_CC); + if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) { + /* defensive copy */ + zend_object_value zov = Z_OBJ_HANDLER_P(zv, clone_obj)(zv TSRMLS_CC); + MAKE_STD_ZVAL(zv); + Z_TYPE_P(zv) = IS_OBJECT; + Z_OBJVAL_P(zv) = zov; + } + + return zv; +} +/* }}} */ + +/* {{{ date_period_write_property */ +static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) +{ + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Writing to DatePeriod properties is unsupported"); +} +/* }}} */ + + /* * Local variables: * tab-width: 4 diff --git a/ext/date/php_date.h b/ext/date/php_date.h index f0b662b5d..be0df38b6 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -88,6 +88,8 @@ PHP_FUNCTION(date_interval_format); PHP_FUNCTION(date_interval_create_from_date_string); PHP_METHOD(DatePeriod, __construct); +PHP_METHOD(DatePeriod, __wakeup); +PHP_METHOD(DatePeriod, __set_state); /* Options and Configuration */ PHP_FUNCTION(date_default_timezone_set); @@ -163,7 +165,7 @@ ZEND_END_MODULE_GLOBALS(date) #define DATEG(v) (date_globals.v) #endif -/* Backwards compability wrapper */ +/* Backwards compatibility wrapper */ PHPAPI signed long php_parse_date(char *string, signed long *now); PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt); PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC); diff --git a/ext/date/tests/DateInterval_days_prop1.phpt b/ext/date/tests/DateInterval_days_prop1.phpt new file mode 100644 index 000000000..627b8f0b2 --- /dev/null +++ b/ext/date/tests/DateInterval_days_prop1.phpt @@ -0,0 +1,10 @@ +--TEST-- +Wrong var_dump(DateInterval->days) value +--FILE-- +<?php + +$interval = new DateInterval('P2Y4DT6H8M'); + +var_dump($interval->days); +--EXPECT-- +bool(false) diff --git a/ext/date/tests/DateTime_fix_createFromFormat.phpt b/ext/date/tests/DateTime_fix_createFromFormat.phpt new file mode 100644 index 000000000..abde29277 --- /dev/null +++ b/ext/date/tests/DateTime_fix_createFromFormat.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test fix for DateTime when date have textual day with dot or other special char at end +--FILE-- +<?php + +//Set the default time zone +date_default_timezone_set('Europe/London'); + +echo "*** Testing clone on DateTime objects ***\n"; + +// Create a DateTime object.. +$orig = new DateTime('2012-11-29 17:00:00'); + +// String to parse +$string = "Thu., Nov. 29, 2012 5:00PM"; + +// Create a DateTime object from format +$fromFormat = DateTime::createFromFormat( "D., M# j, Y g:iA", $string ); + +echo "Format method: " . $orig->format("D., M. j, Y g:iA") . "\n"; +echo "createFromFormat method: " . $fromFormat->format("D., M. j, Y g:iA") . "\n"; + +?> +===DONE=== +--EXPECTF-- +*** Testing clone on DateTime objects *** +Format method: Thu., Nov. 29, 2012 5:00PM +createFromFormat method: Thu., Nov. 29, 2012 5:00PM +===DONE=== diff --git a/ext/date/tests/bug45682.phpt b/ext/date/tests/bug45682.phpt index d8bbfc5a0..ea8fa9470 100644 --- a/ext/date/tests/bug45682.phpt +++ b/ext/date/tests/bug45682.phpt @@ -11,8 +11,8 @@ $other = new DateTime("31-July-2008"); $diff = date_diff($date, $other); var_dump($diff); ---EXPECT-- -object(DateInterval)#3 (8) { +--EXPECTF-- +object(DateInterval)#%d (15) { ["y"]=> int(0) ["m"]=> @@ -25,8 +25,22 @@ object(DateInterval)#3 (8) { int(0) ["s"]=> int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) ["invert"]=> int(0) ["days"]=> int(3) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) } diff --git a/ext/date/tests/bug48678.phpt b/ext/date/tests/bug48678.phpt index e2cb724f7..253cb84ce 100644 --- a/ext/date/tests/bug48678.phpt +++ b/ext/date/tests/bug48678.phpt @@ -15,8 +15,15 @@ DateInterval Object [h] => 12 [i] => 30 [s] => 5 + [weekday] => 0 + [weekday_behavior] => 0 + [first_last_day_of] => 0 [invert] => 0 - [days] =>%s + [days] => + [special_type] => 0 + [special_amount] => 0 + [have_weekday_relative] => 0 + [have_special_relative] => 0 ) DateInterval Object ( @@ -26,6 +33,13 @@ DateInterval Object [h] => 12 [i] => 30 [s] => 5 + [weekday] => 0 + [weekday_behavior] => 0 + [first_last_day_of] => 0 [invert] => 0 - [days] =>%s + [days] => 0 + [special_type] => 0 + [special_amount] => 0 + [have_weekday_relative] => 0 + [have_special_relative] => 0 ) diff --git a/ext/date/tests/bug49081.phpt b/ext/date/tests/bug49081.phpt index f4f02903d..31f735148 100644 --- a/ext/date/tests/bug49081.phpt +++ b/ext/date/tests/bug49081.phpt @@ -17,6 +17,13 @@ DateInterval Object [h] => 4 [i] => 0 [s] => 0 + [weekday] => 0 + [weekday_behavior] => 0 + [first_last_day_of] => 0 [invert] => 0 [days] => 30 + [special_type] => 0 + [special_amount] => 0 + [have_weekday_relative] => 0 + [have_special_relative] => 0 ) diff --git a/ext/date/tests/bug49778.phpt b/ext/date/tests/bug49778.phpt index 67c8e27f9..2062d6916 100644 --- a/ext/date/tests/bug49778.phpt +++ b/ext/date/tests/bug49778.phpt @@ -8,7 +8,7 @@ echo $i->format("%d"), "\n"; echo $i->format("%a"), "\n"; ?> --EXPECT-- -object(DateInterval)#1 (8) { +object(DateInterval)#1 (15) { ["y"]=> int(0) ["m"]=> @@ -21,10 +21,24 @@ object(DateInterval)#1 (8) { int(0) ["s"]=> int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) ["invert"]=> int(0) ["days"]=> bool(false) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) } 7 (unknown) diff --git a/ext/date/tests/bug52062.phpt b/ext/date/tests/bug52062.phpt index 1d814377c..81e767b0f 100644 --- a/ext/date/tests/bug52062.phpt +++ b/ext/date/tests/bug52062.phpt @@ -4,8 +4,6 @@ Bug #52062 (large timestamps with DateTime::getTimestamp and DateTime::setTimest <?php if (PHP_INT_SIZE == 8) die('skip 32-bit only'); ?> ---XFAIL-- -Waiting for resolution of the 32-bit case. --INI-- date.timezone=UTC --FILE-- diff --git a/ext/date/tests/bug52113.phpt b/ext/date/tests/bug52113.phpt index a7d9339d1..f4730c6a4 100644 --- a/ext/date/tests/bug52113.phpt +++ b/ext/date/tests/bug52113.phpt @@ -32,7 +32,7 @@ var_dump($unser, $p); ?> --EXPECT-- -object(DateInterval)#3 (8) { +object(DateInterval)#3 (15) { ["y"]=> int(0) ["m"]=> @@ -45,12 +45,26 @@ object(DateInterval)#3 (8) { int(0) ["s"]=> int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) ["invert"]=> int(0) ["days"]=> int(0) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) } -string(128) "O:12:"DateInterval":8:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:6:"invert";i:0;s:4:"days";i:0;}" +string(320) "O:12:"DateInterval":15:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";i:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}" DateInterval::__set_state(array( 'y' => 0, 'm' => 0, @@ -58,9 +72,16 @@ DateInterval::__set_state(array( 'h' => 4, 'i' => 0, 's' => 0, + 'weekday' => 0, + 'weekday_behavior' => 0, + 'first_last_day_of' => 0, 'invert' => 0, 'days' => 0, -))object(DateInterval)#5 (8) { + 'special_type' => 0, + 'special_amount' => 0, + 'have_weekday_relative' => 0, + 'have_special_relative' => 0, +))object(DateInterval)#5 (15) { ["y"]=> int(0) ["m"]=> @@ -73,14 +94,78 @@ DateInterval::__set_state(array( int(0) ["s"]=> int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) ["invert"]=> int(0) ["days"]=> int(0) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) } -object(DatePeriod)#6 (0) { +object(DatePeriod)#6 (6) { + ["start"]=> + object(DateTime)#4 (3) { + ["date"]=> + string(19) "2003-01-02 08:00:00" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" + } + ["current"]=> + NULL + ["end"]=> + NULL + ["interval"]=> + object(DateInterval)#7 (15) { + ["y"]=> + int(0) + ["m"]=> + int(0) + ["d"]=> + int(0) + ["h"]=> + int(4) + ["i"]=> + int(0) + ["s"]=> + int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + int(0) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) + } + ["recurrences"]=> + int(3) + ["include_start_date"]=> + bool(true) } -object(DateInterval)#4 (8) { +object(DateInterval)#8 (15) { ["y"]=> int(7) ["m"]=> @@ -93,10 +178,74 @@ object(DateInterval)#4 (8) { int(3) ["s"]=> int(2) + ["weekday"]=> + int(-1) + ["weekday_behavior"]=> + int(-1) + ["first_last_day_of"]=> + int(-1) ["invert"]=> int(1) ["days"]=> int(2400) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(-1) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) } -object(DatePeriod)#7 (0) { +object(DatePeriod)#9 (6) { + ["start"]=> + object(DateTime)#6 (3) { + ["date"]=> + string(19) "2003-01-02 08:00:00" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" + } + ["current"]=> + NULL + ["end"]=> + NULL + ["interval"]=> + object(DateInterval)#7 (15) { + ["y"]=> + int(0) + ["m"]=> + int(0) + ["d"]=> + int(0) + ["h"]=> + int(4) + ["i"]=> + int(0) + ["s"]=> + int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + int(0) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) + } + ["recurrences"]=> + int(3) + ["include_start_date"]=> + bool(true) } diff --git a/ext/date/tests/bug52738.phpt b/ext/date/tests/bug52738.phpt index fc1b6029e..ea219f7c7 100644 --- a/ext/date/tests/bug52738.phpt +++ b/ext/date/tests/bug52738.phpt @@ -27,6 +27,13 @@ di Object [h] => 0 [i] => 0 [s] => 0 + [weekday] => 0 + [weekday_behavior] => 0 + [first_last_day_of] => 0 [invert] => 0 [days] => + [special_type] => 0 + [special_amount] => 0 + [have_weekday_relative] => 0 + [have_special_relative] => 0 ) diff --git a/ext/date/tests/bug52808.phpt b/ext/date/tests/bug52808.phpt index e031ac6ee..1f0fc84cd 100644 --- a/ext/date/tests/bug52808.phpt +++ b/ext/date/tests/bug52808.phpt @@ -25,7 +25,7 @@ foreach($intervals as $iv) { echo "==DONE==\n"; ?> --EXPECTF-- -object(DateInterval)#%d (8) { +object(DateInterval)#%d (15) { ["y"]=> int(1) ["m"]=> @@ -38,12 +38,26 @@ object(DateInterval)#%d (8) { int(30) ["s"]=> int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) ["invert"]=> int(1) ["days"]=> int(437) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) } -object(DateInterval)#%d (8) { +object(DateInterval)#%d (15) { ["y"]=> int(0) ["m"]=> @@ -56,12 +70,26 @@ object(DateInterval)#%d (8) { int(30) ["s"]=> int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) ["invert"]=> int(0) ["days"]=> int(294) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) } -object(DateInterval)#%d (8) { +object(DateInterval)#%d (15) { ["y"]=> int(0) ["m"]=> @@ -74,10 +102,24 @@ object(DateInterval)#%d (8) { int(30) ["s"]=> int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) ["invert"]=> int(0) ["days"]=> int(294) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) } DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z/) DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z) diff --git a/ext/date/tests/bug53437.phpt b/ext/date/tests/bug53437.phpt index f08986653..2ea091453 100644 --- a/ext/date/tests/bug53437.phpt +++ b/ext/date/tests/bug53437.phpt @@ -1,7 +1,5 @@ --TEST-- -Bug #53437 (Crash when using unserialized DatePeriod instance) ---XFAIL-- -Bug #53437 Not fixed yet +Bug #53437 (Crash when using unserialized DatePeriod instance), variation 1 --FILE-- <?php $dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new DateInterval('P1D'), 2); @@ -20,9 +18,137 @@ $dpu = unserialize($ser); // $dpu has invalid values??? var_dump($dpu); echo "Unserialized:\r\n"; -// ???which leads to CRASH: foreach($dpu as $dt) { echo $dt->format('Y-m-d H:i:s')."\r\n"; } ?> +==DONE== --EXPECT-- +Original: +2010-01-01 00:00:00 +2010-01-02 00:00:00 +2010-01-03 00:00:00 + +object(DatePeriod)#1 (6) { + ["start"]=> + object(DateTime)#2 (3) { + ["date"]=> + string(19) "2010-01-01 00:00:00" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" + } + ["current"]=> + object(DateTime)#4 (3) { + ["date"]=> + string(19) "2010-01-04 00:00:00" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" + } + ["end"]=> + NULL + ["interval"]=> + object(DateInterval)#5 (15) { + ["y"]=> + int(0) + ["m"]=> + int(0) + ["d"]=> + int(1) + ["h"]=> + int(0) + ["i"]=> + int(0) + ["s"]=> + int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + bool(false) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) + } + ["recurrences"]=> + int(3) + ["include_start_date"]=> + bool(true) +} +object(DatePeriod)#5 (6) { + ["start"]=> + object(DateTime)#10 (3) { + ["date"]=> + string(19) "2010-01-01 00:00:00" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" + } + ["current"]=> + object(DateTime)#7 (3) { + ["date"]=> + string(19) "2010-01-04 00:00:00" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" + } + ["end"]=> + NULL + ["interval"]=> + object(DateInterval)#8 (15) { + ["y"]=> + int(0) + ["m"]=> + int(0) + ["d"]=> + int(1) + ["h"]=> + int(0) + ["i"]=> + int(0) + ["s"]=> + int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + int(0) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) + } + ["recurrences"]=> + int(3) + ["include_start_date"]=> + bool(true) +} +Unserialized: +2010-01-01 00:00:00 +2010-01-02 00:00:00 +2010-01-03 00:00:00 +==DONE== diff --git a/ext/date/tests/bug53437_var1.phpt b/ext/date/tests/bug53437_var1.phpt new file mode 100644 index 000000000..f1f9843d5 --- /dev/null +++ b/ext/date/tests/bug53437_var1.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #53437 (Crash when using unserialized DatePeriod instance), variation 2 +--FILE-- +<?php +$s = 'O:10:"DatePeriod":0:{}'; + +$dp = unserialize($s); + +var_dump($dp); +?> +==DONE== +--EXPECTF-- +Fatal error: Invalid serialization data for DatePeriod object in %sbug53437_var1.php on line %d diff --git a/ext/date/tests/bug53437_var2.phpt b/ext/date/tests/bug53437_var2.phpt new file mode 100644 index 000000000..50aebda57 --- /dev/null +++ b/ext/date/tests/bug53437_var2.phpt @@ -0,0 +1,80 @@ +--TEST-- +Bug #53437 DateInterval basic serialization +--FILE-- +<?php +$di0 = new DateInterval('P2Y4DT6H8M'); + +$s = serialize($di0); + +$di1 = unserialize($s); + +var_dump($di0, $di1); + +?> +==DONE== +--EXPECT-- +object(DateInterval)#1 (15) { + ["y"]=> + int(2) + ["m"]=> + int(0) + ["d"]=> + int(4) + ["h"]=> + int(6) + ["i"]=> + int(8) + ["s"]=> + int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + bool(false) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) +} +object(DateInterval)#2 (15) { + ["y"]=> + int(2) + ["m"]=> + int(0) + ["d"]=> + int(4) + ["h"]=> + int(6) + ["i"]=> + int(8) + ["s"]=> + int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + int(0) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) +} +==DONE== diff --git a/ext/date/tests/bug53437_var3.phpt b/ext/date/tests/bug53437_var3.phpt new file mode 100644 index 000000000..82b90f559 --- /dev/null +++ b/ext/date/tests/bug53437_var3.phpt @@ -0,0 +1,47 @@ +--TEST-- +Bug #53437 DateInterval unserialize bad data, 32 bit +--SKIPIF-- +<?php if (PHP_INT_SIZE != 4) { die('skip 32 bit only'); } ?> +--FILE-- +<?php +$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}'; + +$di = unserialize($s); +var_dump($di); + +?> +==DONE== +--EXPECTF-- +object(DateInterval)#%d (15) { + ["y"]=> + int(2) + ["m"]=> + int(0) + ["d"]=> + int(0) + ["h"]=> + int(6) + ["i"]=> + int(8) + ["s"]=> + int(0) + ["weekday"]=> + int(10) + ["weekday_behavior"]=> + int(10) + ["first_last_day_of"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + int(0) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(-1) + ["have_weekday_relative"]=> + int(9) + ["have_special_relative"]=> + int(0) +} +==DONE== diff --git a/ext/date/tests/bug53437_var4.phpt b/ext/date/tests/bug53437_var4.phpt new file mode 100644 index 000000000..88fd81c9d --- /dev/null +++ b/ext/date/tests/bug53437_var4.phpt @@ -0,0 +1,64 @@ +--TEST-- +Bug #53437 (Check that var_dump out is the same using the whole object or it's single properties), variation 4 +--INI-- +date.timezone = Europe/Berlin +--FILE-- +<?php +$dt = new DateTime('2009-10-11'); + +$df = $dt->diff(new DateTime('2009-10-13')); + +var_dump($df, + $df->y, + $df->m, + $df->d, + $df->h, + $df->i, + $df->s, + $df->invert, + $df->days); + +?> +==DONE== +--EXPECTF-- +object(DateInterval)#%d (15) { + ["y"]=> + int(0) + ["m"]=> + int(0) + ["d"]=> + int(2) + ["h"]=> + int(0) + ["i"]=> + int(0) + ["s"]=> + int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + int(2) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) +} +int(0) +int(0) +int(2) +int(0) +int(0) +int(0) +int(0) +int(2) +==DONE== diff --git a/ext/date/tests/bug53437_var5.phpt b/ext/date/tests/bug53437_var5.phpt new file mode 100644 index 000000000..e95fcdae9 --- /dev/null +++ b/ext/date/tests/bug53437_var5.phpt @@ -0,0 +1,47 @@ +--TEST-- +Bug #53437 DateInterval unserialize bad data, 64 bit +--SKIPIF-- +<?php if (PHP_INT_SIZE != 8) { die('skip true 64 bit only'); } ?> +--FILE-- +<?php +$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}'; + +$di = unserialize($s); +var_dump($di); + +?> +==DONE== +--EXPECTF-- +object(DateInterval)#%d (15) { + ["y"]=> + int(2) + ["m"]=> + int(0) + ["d"]=> + int(0) + ["h"]=> + int(6) + ["i"]=> + int(8) + ["s"]=> + int(0) + ["weekday"]=> + int(10) + ["weekday_behavior"]=> + int(10) + ["first_last_day_of"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + int(0) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(9223372036854775807) + ["have_weekday_relative"]=> + int(9) + ["have_special_relative"]=> + int(0) +} +==DONE== diff --git a/ext/date/tests/bug55397.phpt b/ext/date/tests/bug55397.phpt index 13778a00b..7c9bbb01c 100644 --- a/ext/date/tests/bug55397.phpt +++ b/ext/date/tests/bug55397.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #55397 (comparsion of incomplete DateTime causes SIGSEGV) +Bug #55397 (comparison of incomplete DateTime causes SIGSEGV) --INI-- --FILE-- <?php diff --git a/ext/date/tests/bug64157.phpt b/ext/date/tests/bug64157.phpt new file mode 100644 index 000000000..fb7149543 --- /dev/null +++ b/ext/date/tests/bug64157.phpt @@ -0,0 +1,14 @@ +--TEST-- +Test for bug #64157: DateTime::createFromFormat() reports confusing error message +--CREDITS-- +Boro Sitnikovski <buritomath@yahoo.com> +--INI-- +date.timezone = UTC +--FILE-- +<?php +DateTime::createFromFormat('s', '0'); +$lastErrors = DateTime::getLastErrors(); +print_r($lastErrors['errors'][0]); +?> +--EXPECT-- +A two digit second could not be found diff --git a/ext/date/tests/date_diff1.phpt b/ext/date/tests/date_diff1.phpt index cf32fcbf3..a908cdba7 100644 --- a/ext/date/tests/date_diff1.phpt +++ b/ext/date/tests/date_diff1.phpt @@ -28,7 +28,7 @@ object(DateTime)#2 (3) { ["timezone"]=> string(3) "EDT" } -object(DateInterval)#3 (8) { +object(DateInterval)#3 (15) { ["y"]=> int(0) ["m"]=> @@ -41,8 +41,22 @@ object(DateInterval)#3 (8) { int(19) ["s"]=> int(40) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) ["invert"]=> int(0) ["days"]=> int(33) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) } diff --git a/ext/date/tests/date_sunrise_and_sunset_basic.phpt b/ext/date/tests/date_sunrise_and_sunset_basic.phpt index a96fa8303..f89b63fd9 100644 --- a/ext/date/tests/date_sunrise_and_sunset_basic.phpt +++ b/ext/date/tests/date_sunrise_and_sunset_basic.phpt @@ -14,7 +14,7 @@ offset: +1 GMT echo "Basic test for date_sunrise() and date_sunset()\n"; -// supress date() function strict msgs +// suppress date() function strict msgs error_reporting(E_ALL & ~E_STRICT); echo date("D M d Y") . ', sunrise time : ' . date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n"; diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 303d65c33..50a94dd2a 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -226,12 +226,17 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS *key_free = *key_str; return len; } else { - *key_free = NULL; + zval tmp = *key; + int len; - convert_to_string(key); - *key_str = Z_STRVAL_P(key); + zval_copy_ctor(&tmp); + convert_to_string(&tmp); - return Z_STRLEN_P(key); + *key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); + len = Z_STRLEN(tmp); + + zval_dtor(&tmp); + return len; } } /* }}} */ @@ -297,6 +302,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS RETURN_FALSE; \ } +/* the same check, but with a call to DBA_ID_DONE before returning */ +#define DBA_WRITE_CHECK_WITH_ID \ + if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \ + DBA_ID_DONE; \ + RETURN_FALSE; \ + } + /* }}} */ /* {{{ globals */ @@ -538,7 +551,6 @@ PHP_MINFO_FUNCTION(dba) */ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) { - char *v; int val_len; zval *id; dba_info *info = NULL; @@ -558,7 +570,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) DBA_FETCH_RESOURCE(info, &id); - DBA_WRITE_CHECK; + DBA_WRITE_CHECK_WITH_ID; if (info->hnd->update(info, key_str, key_len, val, val_len, mode TSRMLS_CC) == SUCCESS) { DBA_ID_DONE; @@ -889,7 +901,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) RETURN_FALSE; } if (hptr->flags & (DBA_NO_APPEND|DBA_CAST_AS_FD)) { - /* Needed becasue some systems do not allow to write to the original + /* Needed because some systems do not allow to write to the original * file contents with O_APPEND being set. */ if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&info->fd, 1)) { @@ -1111,7 +1123,7 @@ PHP_FUNCTION(dba_delete) { DBA_ID_GET2; - DBA_WRITE_CHECK; + DBA_WRITE_CHECK_WITH_ID; if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS) { diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index 89373b1e3..3cd97702b 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -460,7 +460,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML */ static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append TSRMLS_DC) { - size_t pos_grp_start, pos_grp_next; + size_t pos_grp_start = 0, pos_grp_next; inifile *ini_tmp = NULL; php_stream *fp_tmp = NULL; int ret; diff --git a/ext/dba/tests/bug38698.phpt b/ext/dba/tests/bug38698.phpt index 56dde8526..1d1ed674f 100644 --- a/ext/dba/tests/bug38698.phpt +++ b/ext/dba/tests/bug38698.phpt @@ -8,10 +8,18 @@ Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't --FILE-- <?php +function isLittleEndian() { + return 0x00FF === current(unpack('v', pack('S',0x00FF))); +} + $db_file = dirname(__FILE__) .'/129php.cdb'; if (($db_make=dba_open($db_file, "n", 'cdb_make'))!==FALSE) { - dba_insert(pack('i',129), "Booo!", $db_make); + if (isLittleEndian() === FALSE) { + dba_insert(pack('V',129), "Booo!", $db_make); + } else{ + dba_insert(pack('i',129), "Booo!", $db_make); + } dba_close($db_make); // write md5 checksum of generated database file var_dump(md5_file($db_file)); diff --git a/ext/dba/tests/bug65708.phpt b/ext/dba/tests/bug65708.phpt new file mode 100644 index 000000000..b77138f6e --- /dev/null +++ b/ext/dba/tests/bug65708.phpt @@ -0,0 +1,38 @@ +--TEST-- +Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write) +--SKIPIF-- +<?php + require_once(dirname(__FILE__) .'/skipif.inc'); +?> +--FILE-- +<?php + +error_reporting(E_ALL); + +require_once(dirname(__FILE__) .'/test.inc'); + +$db = dba_popen($db_filename, 'c'); + +$key = 1; +$copy = $key; + +echo gettype($key)."\n"; +echo gettype($copy)."\n"; + +dba_exists($key, $db); + +echo gettype($key)."\n"; +echo gettype($copy)."\n"; + +dba_close($db); + +?> +--CLEAN-- +<?php + require(dirname(__FILE__) .'/clean.inc'); +?> +--EXPECT-- +integer +integer +integer +integer diff --git a/ext/dba/tests/dba_cdb_read.phpt b/ext/dba/tests/dba_cdb_read.phpt index 71575f5d8..a782a572e 100644 --- a/ext/dba/tests/dba_cdb_read.phpt +++ b/ext/dba/tests/dba_cdb_read.phpt @@ -20,7 +20,7 @@ DBA CDB handler test (read only) $keys .= $a; $count++; } - // display number of entries and key existance + // display number of entries and key existence echo $count; for ($i=1; $i<8; $i++) { echo dba_exists($i, $db_file) ? "Y" : "N"; diff --git a/ext/dba/tests/dba_gdbm.phpt b/ext/dba/tests/dba_gdbm.phpt index 33d7d2061..8ac3f6474 100644 --- a/ext/dba/tests/dba_gdbm.phpt +++ b/ext/dba/tests/dba_gdbm.phpt @@ -12,7 +12,7 @@ DBA GDBM handler test $lock_flag = ''; // lock in library require_once dirname(__FILE__) .'/dba_handler.inc'; - // Read during write is system dependant. Important is that there is no deadlock + // Read during write is system dependent. Important is that there is no deadlock ?> ===DONE=== --EXPECTF-- diff --git a/ext/dom/element.c b/ext/dom/element.c index f217ca245..606a23f9c 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -177,7 +177,7 @@ PHP_METHOD(domelement, __construct) RETURN_FALSE; } - /* Namespace logic is seperate and only when uri passed in to insure no BC breakage */ + /* Namespace logic is separate and only when uri passed in to insure no BC breakage */ if (uri_len > 0) { errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); if (errorcode == 0) { diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index c3b0ee037..bd9c98756 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1089,7 +1089,11 @@ void dom_xpath_objects_free_storage(void *object TSRMLS_DC) void dom_objects_free_storage(void *object TSRMLS_DC) { dom_object *intern = (dom_object *)object; +#if defined(__GNUC__) && __GNUC__ >= 3 + int retcount __attribute__((unused)); /* keep compiler quiet */ +#else int retcount; +#endif zend_object_std_dtor(&intern->std TSRMLS_CC); diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile.phpt new file mode 100644 index 000000000..93a614903 --- /dev/null +++ b/ext/dom/tests/DOMDocument_loadHTMLfile.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test DOMDocument::loadHTMLFile +--DESCRIPTION-- +Verifies the basic behaviour of the method +--CREDITS-- +Antonio Diaz Ruiz <dejalatele@gmail.com> +--INI-- +assert.bail=true +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php +$doc = new DOMDocument(); +$result = $doc->loadHTMLFile(dirname(__FILE__) . "/test.html"); +assert('$result === true'); +?> +--EXPECT-- diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_error1.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_error1.phpt new file mode 100644 index 000000000..aee51966a --- /dev/null +++ b/ext/dom/tests/DOMDocument_loadHTMLfile_error1.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test DOMDocument::loadHTMLFile when the file doesn't exist +--DESCRIPTION-- +Verifies that an error message is showed if the file doesn't exist +--CREDITS-- +Antonio Diaz Ruiz <dejalatele@gmail.com> +--INI-- +assert.bail=true +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php +$doc = new DOMDocument(); +$result = $doc->loadHTMLFile(dirname(__FILE__) . "/ffff/test.html"); +assert('$result === false'); +?> +--EXPECTF-- +%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): I/O warning : failed to load external entity %s diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt new file mode 100644 index 000000000..e59ff56c5 --- /dev/null +++ b/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test DOMDocument::loadHTMLFile when an empty string is passed +--DESCRIPTION-- +Verifies that an error message is showed if an empty string is passed as argument +--CREDITS-- +Antonio Diaz Ruiz <dejalatele@gmail.com> +--INI-- +assert.bail=true +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php +$doc = new DOMDocument(); +$result = $doc->loadHTMLFile(""); +assert('$result === false'); +?> +--EXPECTF-- +%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Empty string supplied as input %s diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt new file mode 100644 index 000000000..2535772c7 --- /dev/null +++ b/ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test DOMDocument::loadHTMLFile when an empty document is loaded +--DESCRIPTION-- +Verifies that an warning message is showed if an empty document is loaded +--CREDITS-- +Antonio Diaz Ruiz <dejalatele@gmail.com> +--INI-- +assert.bail=true +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php +$doc = new DOMDocument(); +$result = $doc->loadHTMLFile(dirname(__FILE__) . "/empty.html"); +assert('$result === true'); +?> +--EXPECTF-- +%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Document is empty %s diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_variation2.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_variation2.phpt new file mode 100644 index 000000000..829686dd6 --- /dev/null +++ b/ext/dom/tests/DOMDocument_loadHTMLfile_variation2.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test DOMDocument::loadHTMLFile when a not-well formed document is loaded +--DESCRIPTION-- +Verifies the behavior if a not-well formed document is loaded +--CREDITS-- +Antonio Diaz Ruiz <dejalatele@gmail.com> +--INI-- +assert.bail=true +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php +$doc = new DOMDocument(); +$result = $doc->loadHTMLFile(dirname(__FILE__) . "/not_well.html"); +assert('$result === true'); +?> +--EXPECT-- diff --git a/ext/dom/tests/DOMDocument_schemaValidate_error5.phpt b/ext/dom/tests/DOMDocument_schemaValidate_error5.phpt index d3f0658c1..d5743bc6c 100644 --- a/ext/dom/tests/DOMDocument_schemaValidate_error5.phpt +++ b/ext/dom/tests/DOMDocument_schemaValidate_error5.phpt @@ -1,5 +1,5 @@ --TEST-- -DomDocument::schemaValidate() - non-existant schema file +DomDocument::schemaValidate() - non-existent schema file --CREDITS-- Daniel Convissor <danielc@php.net> # TestFest 2009 NYPHP @@ -12,14 +12,14 @@ $doc = new DOMDocument; $doc->load(dirname(__FILE__)."/book.xml"); -$result = $doc->schemaValidate(dirname(__FILE__)."/non-existant-file"); +$result = $doc->schemaValidate(dirname(__FILE__)."/non-existent-file"); var_dump($result); ?> --EXPECTF-- -Warning: DOMDocument::schemaValidate(): I/O warning : failed to load external entity "%snon-existant-file" in %s.php on line %d +Warning: DOMDocument::schemaValidate(): I/O warning : failed to load external entity "%snon-existent-file" in %s.php on line %d -Warning: DOMDocument::schemaValidate(): Failed to locate the main schema resource at '%s/non-existant-file'. in %s.php on line %d +Warning: DOMDocument::schemaValidate(): Failed to locate the main schema resource at '%s/non-existent-file'. in %s.php on line %d Warning: DOMDocument::schemaValidate(): Invalid Schema in %s.php on line %d bool(false) diff --git a/ext/dom/tests/DOMNode_removeChild_basic.phpt b/ext/dom/tests/DOMNode_removeChild_basic.phpt index 384eb47b5..fb0977488 100644 --- a/ext/dom/tests/DOMNode_removeChild_basic.phpt +++ b/ext/dom/tests/DOMNode_removeChild_basic.phpt @@ -39,7 +39,7 @@ $root = $dom->documentElement; $children = $root->childNodes; $len = $children->length; -echo "orignal has $len nodes\n"; +echo "original has $len nodes\n"; for ($index = $children->length - 1; $index >=0; $index--) { echo "node $index\n"; $current = $children->item($index); @@ -58,7 +58,7 @@ for ($index = 0; $index < $children->length; $index++) { } --EXPECTF-- -orignal has 5 nodes +original has 5 nodes node 4 Course: no title:DOMText ~string(1) " diff --git a/ext/dom/tests/bug44648.phpt b/ext/dom/tests/bug44648.phpt index d04f590ac..4ff7ac389 100644 --- a/ext/dom/tests/bug44648.phpt +++ b/ext/dom/tests/bug44648.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #44648 (Attribute names not checked for wellformedness) +Bug #44648 (Attribute names not checked for well formedness) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/empty.html b/ext/dom/tests/empty.html new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ext/dom/tests/empty.html diff --git a/ext/dom/tests/not_well.html b/ext/dom/tests/not_well.html new file mode 100644 index 000000000..151f46295 --- /dev/null +++ b/ext/dom/tests/not_well.html @@ -0,0 +1,8 @@ +<head> +<title>Hello world</title> +</head> +<body> +This is a not well-formed<br> +html files with undeclared entities +</body> +</html> diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index cf556a350..d12ef3032 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -74,7 +74,7 @@ const zend_function_entry php_dom_xpath_class_functions[] = { static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) /* {{{ */ { - zval **args; + zval **args = NULL; zval *retval; int result, i, ret; int error = 0; diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index e4b426376..98b5c9fd8 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -651,7 +651,7 @@ PHP_FUNCTION(enchant_broker_free_dict) /* }}} */ /* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag) - Wether a dictionary exists or not. Using non-empty tag */ + Whether a dictionary exists or not. Using non-empty tag */ PHP_FUNCTION(enchant_broker_dict_exists) { zval *broker; @@ -674,7 +674,7 @@ PHP_FUNCTION(enchant_broker_dict_exists) described/referred to by 'tag'. The ordering is a comma delimited list of provider names. As a special exception, the "*" tag can be used as a language tag to declare a default ordering for any - language that does not explictly declare an ordering. */ + language that does not explicitly declare an ordering. */ PHP_FUNCTION(enchant_broker_set_ordering) { diff --git a/ext/exif/exif.c b/ext/exif/exif.c index c69107589..bd646d9ad 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2595,7 +2595,7 @@ static int exif_process_string_raw(char **result, char *value, size_t byte_count /* {{{ exif_process_string * Copy a string in Exif header to a character string and return length of allocated buffer if any. - * In contrast to exif_process_string this function does allways return a string buffer */ + * In contrast to exif_process_string this function does always return a string buffer */ static int exif_process_string(char **result, char *value, size_t byte_count TSRMLS_DC) { /* we cannot use strlcpy - here the problem is that we cannot use strlen to * determin length of string and we cannot use strlcpy with len=byte_count+1 diff --git a/ext/exif/tests/exif_tagname_variation1.phpt b/ext/exif/tests/exif_tagname_variation1.phpt index da899194c..0f9c13542 100644 --- a/ext/exif/tests/exif_tagname_variation1.phpt +++ b/ext/exif/tests/exif_tagname_variation1.phpt @@ -78,7 +78,7 @@ $values = array ( // loop through each element of the array and check the working of exif_tagname() -// when $index arugment is supplied with different values +// when $index argument is supplied with different values echo "\n--- Testing exif_tagname() by supplying different values for 'index' argument ---\n"; $counter = 1; diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch index a35ff6745..97e771e92 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 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/apprentice.c 2013-04-08 16:14:17.828357711 +0200 ++++ libmagic/apprentice.c 2013-04-27 13:53:32.175250261 +0200 @@ -29,6 +29,8 @@ * apprentice - make one pass through /etc/magic, learning its secrets. */ @@ -352,7 +352,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c file_oomem(ms, slen); return -1; } -@@ -1102,14 +1121,14 @@ +@@ -1102,27 +1121,29 @@ if (me == NULL) return; for (i = 0; i < nme; i++) @@ -370,8 +370,9 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c struct magic_entry *mentry[MAGIC_SETS] = { NULL }; uint32_t mentrycount[MAGIC_SETS] = { 0 }; uint32_t i, j; -@@ -1117,12 +1136,14 @@ - char **filearr = NULL, *mfn; + size_t files = 0, maxfiles = 0; +- char **filearr = NULL, *mfn; ++ char **filearr = NULL; struct stat st; struct magic_map *map; - DIR *dir; @@ -411,7 +412,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c + int mflen; + char mfn[MAXPATHLEN]; + -+ dir = php_stream_opendir(fn, REPORT_ERRORS, NULL); ++ dir = php_stream_opendir((char *)fn, REPORT_ERRORS, NULL); if (!dir) { errs++; goto out; @@ -578,7 +579,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c +#ifdef PHP_WIN32 + /* Don't bother on windows with php_stream_open_wrapper, + return to give apprentice_load() a chance. */ -+ if (php_stream_stat_path_ex(fn, 0, &st, NULL) == SUCCESS) { ++ if (php_stream_stat_path_ex((char *)fn, 0, &st, NULL) == SUCCESS) { + if (st.sb.st_mode & S_IFDIR) { + goto error; + } @@ -751,7 +752,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c } - if (write(fd, map->nmagic, nm) != (ssize_t)nm) { -+ if (php_stream_write(stream, map->nmagic, nm) != (ssize_t)nm) { ++ if (php_stream_write(stream, (const char *)map->nmagic, nm) != (ssize_t)nm) { file_error(ms, errno, "error writing `%s'", dbname); goto out; } @@ -767,7 +768,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c for (i = 0; i < MAGIC_SETS; i++) { len = m * map->nmagic[i]; - if (write(fd, map->magic[i], len) != (ssize_t)len) { -+ if (php_stream_write(stream, map->magic[i], len) != (ssize_t)len) { ++ if (php_stream_write(stream, (const char *)map->magic[i], len) != (ssize_t)len) { file_error(ms, errno, "error writing `%s'", dbname); goto out; } @@ -2047,7 +2048,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c + diff -u libmagic.orig/magic.c libmagic/magic.c --- libmagic.orig/magic.c 2013-01-11 17:43:09.000000000 +0100 -+++ libmagic/magic.c 2013-04-08 15:42:57.328298809 +0200 ++++ libmagic/magic.c 2013-04-27 13:53:32.175250261 +0200 @@ -25,11 +25,6 @@ * SUCH DAMAGE. */ @@ -2089,7 +2090,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c #if defined(HAVE_UTIMES) # include <sys/time.h> #elif defined(HAVE_UTIME) -@@ -71,18 +75,24 @@ +@@ -71,18 +75,25 @@ #endif #endif @@ -2098,14 +2099,14 @@ diff -u libmagic.orig/magic.c libmagic/magic.c +# undef S_IFIFO +#endif + -+private void free_mlist(struct mlist *); private void close_and_restore(const struct magic_set *, const char *, int, const struct stat *); private int unreadable_info(struct magic_set *, mode_t, const char *); ++#if 0 private const char* get_default_magic(void); -#ifndef COMPILE_ONLY -private const char *file_or_fd(struct magic_set *, const char *, int); --#endif + #endif +private const char *file_or_stream(struct magic_set *, const char *, php_stream *); #ifndef STDIN_FILENO @@ -2117,7 +2118,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c private const char * get_default_magic(void) { -@@ -90,7 +100,7 @@ +@@ -90,7 +101,7 @@ static char *default_magic; char *home, *hmagicpath; @@ -2126,7 +2127,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c struct stat st; if (default_magic) { -@@ -104,17 +114,17 @@ +@@ -104,17 +115,17 @@ return MAGIC; if (stat(hmagicpath, &st) == -1) { free(hmagicpath); @@ -2153,7 +2154,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c } if (asprintf(&default_magic, "%s:%s", hmagicpath, MAGIC) < 0) -@@ -128,6 +138,7 @@ +@@ -128,6 +139,7 @@ #else char *hmagicp = hmagicpath; char *tmppath = NULL; @@ -2161,7 +2162,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c #define APPENDPATH() \ do { \ -@@ -172,7 +183,7 @@ +@@ -172,7 +184,7 @@ } /* Third, try to get magic file relative to dll location */ @@ -2170,7 +2171,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c dllpath[MAX_PATH] = 0; /* just in case long path gets truncated and not null terminated */ if (GetModuleFileNameA(NULL, dllpath, MAX_PATH)){ PathRemoveFileSpecA(dllpath); -@@ -210,6 +221,7 @@ +@@ -210,6 +222,7 @@ return action == FILE_LOAD ? get_default_magic() : MAGIC; } @@ -2178,7 +2179,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c public struct magic_set * magic_open(int flags) -@@ -250,7 +262,7 @@ +@@ -250,7 +263,7 @@ magic_load(struct magic_set *ms, const char *magicfile) { if (ms == NULL) @@ -2187,7 +2188,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c return file_apprentice(ms, magicfile, FILE_LOAD); } -@@ -262,13 +274,6 @@ +@@ -262,13 +275,6 @@ return file_apprentice(ms, magicfile, FILE_COMPILE); } @@ -2201,7 +2202,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c public int magic_list(struct magic_set *ms, const char *magicfile) -@@ -282,9 +287,6 @@ +@@ -282,9 +288,6 @@ close_and_restore(const struct magic_set *ms, const char *name, int fd, const struct stat *sb) { @@ -2211,7 +2212,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c if ((ms->flags & MAGIC_PRESERVE_ATIME) != 0) { /* -@@ -311,7 +313,6 @@ +@@ -311,7 +314,6 @@ } } @@ -2219,7 +2220,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c /* * find type of descriptor -@@ -321,7 +322,7 @@ +@@ -321,7 +323,7 @@ { if (ms == NULL) return NULL; @@ -2228,7 +2229,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c } /* -@@ -332,30 +333,42 @@ +@@ -332,30 +334,42 @@ { if (ms == NULL) return NULL; @@ -2277,7 +2278,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c case -1: /* error */ goto done; case 0: /* nothing found */ -@@ -365,68 +378,48 @@ +@@ -365,68 +379,48 @@ goto done; } @@ -2372,7 +2373,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c return rv == 0 ? file_getbuffer(ms) : NULL; } -@@ -440,14 +433,13 @@ +@@ -440,14 +434,13 @@ return NULL; /* * The main work is done here! @@ -2410,8 +2411,8 @@ diff -u libmagic.orig/magic.h libmagic/magic.h diff -u libmagic.orig/print.c libmagic/print.c --- libmagic.orig/print.c 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/print.c 2013-04-08 15:42:57.328298809 +0200 -@@ -28,6 +28,8 @@ ++++ libmagic/print.c 2013-04-27 13:53:32.175250261 +0200 +@@ -28,13 +28,17 @@ /* * print.c - debugging printout routines */ @@ -2419,8 +2420,9 @@ diff -u libmagic.orig/print.c libmagic/print.c +#include "php.h" #include "file.h" ++#include "cdf.h" -@@ -35,6 +37,7 @@ + #ifndef lint FILE_RCSID("@(#)$File: print.c,v 1.76 2013/02/26 18:25:00 christos Exp $") #endif /* lint */ @@ -2428,7 +2430,7 @@ diff -u libmagic.orig/print.c libmagic/print.c #include <string.h> #include <stdarg.h> #include <stdlib.h> -@@ -43,188 +46,28 @@ +@@ -43,188 +47,28 @@ #endif #include <time.h> @@ -2619,7 +2621,7 @@ diff -u libmagic.orig/print.c libmagic/print.c - (void) fprintf(stderr, "Warning: "); va_start(va, f); - (void) vfprintf(stderr, f, va); -+ vasprintf(&expanded_format, f, va); ++ if (vasprintf(&expanded_format, f, va)); /* silence */ va_end(va); - (void) fputc('\n', stderr); + @@ -2629,7 +2631,7 @@ diff -u libmagic.orig/print.c libmagic/print.c } protected const char * -@@ -235,7 +78,7 @@ +@@ -235,7 +79,7 @@ struct tm *tm; if (flags & FILE_T_WINDOWS) { @@ -2976,7 +2978,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 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/softmagic.c 2013-04-08 15:42:57.328298809 +0200 ++++ libmagic/softmagic.c 2013-05-14 11:00:07.044745939 +0200 @@ -41,6 +41,11 @@ #include <stdlib.h> #include <time.h> @@ -3121,7 +3123,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } } -@@ -1717,9 +1694,9 @@ +@@ -1717,12 +1694,12 @@ ms->o.buf = sbuf; ms->offset = soffset; if (rv == 1) { @@ -3132,7 +3134,11 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c + return -1; if (file_printf(ms, "%s", rbuf) == -1) return -1; - free(rbuf); +- free(rbuf); ++ efree(rbuf); + } + return rv; + @@ -1837,6 +1814,42 @@ return file_strncmp(a, b, len, flags); } diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index 8ae572973..11920e658 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -1133,7 +1133,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action) uint32_t mentrycount[MAGIC_SETS] = { 0 }; uint32_t i, j; size_t files = 0, maxfiles = 0; - char **filearr = NULL, *mfn; + char **filearr = NULL; struct stat st; struct magic_map *map; php_stream *dir; @@ -1169,7 +1169,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action) int mflen; char mfn[MAXPATHLEN]; - dir = php_stream_opendir(fn, REPORT_ERRORS, NULL); + dir = php_stream_opendir((char *)fn, REPORT_ERRORS, NULL); if (!dir) { errs++; goto out; @@ -2613,7 +2613,7 @@ apprentice_map(struct magic_set *ms, const char *fn) #ifdef PHP_WIN32 /* Don't bother on windows with php_stream_open_wrapper, return to give apprentice_load() a chance. */ - if (php_stream_stat_path_ex(fn, 0, &st, NULL) == SUCCESS) { + if (php_stream_stat_path_ex((char *)fn, 0, &st, NULL) == SUCCESS) { if (st.sb.st_mode & S_IFDIR) { goto error; } @@ -2778,7 +2778,7 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn) goto out; } - if (php_stream_write(stream, map->nmagic, nm) != (ssize_t)nm) { + if (php_stream_write(stream, (const char *)map->nmagic, nm) != (ssize_t)nm) { file_error(ms, errno, "error writing `%s'", dbname); goto out; } @@ -2792,7 +2792,7 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn) for (i = 0; i < MAGIC_SETS; i++) { len = m * map->nmagic[i]; - if (php_stream_write(stream, map->magic[i], len) != (ssize_t)len) { + if (php_stream_write(stream, (const char *)map->magic[i], len) != (ssize_t)len) { file_error(ms, errno, "error writing `%s'", dbname); goto out; } diff --git a/ext/fileinfo/libmagic/magic.c b/ext/fileinfo/libmagic/magic.c index 15fd6be77..4bcc49eb8 100644 --- a/ext/fileinfo/libmagic/magic.c +++ b/ext/fileinfo/libmagic/magic.c @@ -80,11 +80,12 @@ FILE_RCSID("@(#)$File: magic.c,v 1.78 2013/01/07 18:20:19 christos Exp $") # undef S_IFIFO #endif -private void free_mlist(struct mlist *); private void close_and_restore(const struct magic_set *, const char *, int, const struct stat *); private int unreadable_info(struct magic_set *, mode_t, const char *); +#if 0 private const char* get_default_magic(void); +#endif private const char *file_or_stream(struct magic_set *, const char *, php_stream *); #ifndef STDIN_FILENO diff --git a/ext/fileinfo/libmagic/print.c b/ext/fileinfo/libmagic/print.c index fff258b7e..63e34bee0 100644 --- a/ext/fileinfo/libmagic/print.c +++ b/ext/fileinfo/libmagic/print.c @@ -33,6 +33,7 @@ #include "php.h" #include "file.h" +#include "cdf.h" #ifndef lint FILE_RCSID("@(#)$File: print.c,v 1.76 2013/02/26 18:25:00 christos Exp $") @@ -63,7 +64,7 @@ file_magwarn(struct magic_set *ms, const char *f, ...) TSRMLS_FETCH(); va_start(va, f); - vasprintf(&expanded_format, f, va); + if (vasprintf(&expanded_format, f, va)); /* silence */ va_end(va); php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Warning: %s", expanded_format); diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c index c69fdb5a3..0671fa99f 100644 --- a/ext/fileinfo/libmagic/softmagic.c +++ b/ext/fileinfo/libmagic/softmagic.c @@ -1630,7 +1630,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, /* Verify we have enough data to match magic type */ switch (m->type) { case FILE_BYTE: - if (nbytes < (offset + 1)) /* should alway be true */ + if (nbytes < (offset + 1)) /* should always be true */ return 0; break; @@ -1699,7 +1699,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, return -1; if (file_printf(ms, "%s", rbuf) == -1) return -1; - free(rbuf); + efree(rbuf); } return rv; diff --git a/ext/fileinfo/tests/finfo_file_002.phpt b/ext/fileinfo/tests/finfo_file_002.phpt index 3593233c3..feb4010f7 100644 --- a/ext/fileinfo/tests/finfo_file_002.phpt +++ b/ext/fileinfo/tests/finfo_file_002.phpt @@ -18,7 +18,7 @@ ksort($results); var_dump($results); ?> --EXPECTF-- -array(7) { +array(8) { ["%s/resources/dir.zip"]=> string(15) "application/zip" ["%s/resources/test.awk"]=> @@ -29,6 +29,8 @@ array(7) { string(9) "image/gif" ["%s/resources/test.jpg"]=> string(10) "image/jpeg" + ["%s/resources/test.mp3"]=> + string(10) "audio/mpeg" ["%s/resources/test.pdf"]=> string(15) "application/pdf" ["%s/resources/test.png"]=> diff --git a/ext/fileinfo/tests/finfo_phpinfo_basic.phpt b/ext/fileinfo/tests/finfo_phpinfo_basic.phpt index c43ba4e29..7d1b008d5 100644 --- a/ext/fileinfo/tests/finfo_phpinfo_basic.phpt +++ b/ext/fileinfo/tests/finfo_phpinfo_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -Test finfo extention : loading into phpinfo() +Test finfo extension : loading into phpinfo() --SKIPIF-- <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> --FILE-- diff --git a/ext/fileinfo/tests/magic b/ext/fileinfo/tests/magic index 5266dd0dc..aa75fb65b 100644 --- a/ext/fileinfo/tests/magic +++ b/ext/fileinfo/tests/magic @@ -3303,7 +3303,7 @@ >>>0x44 string =GLOB \b. >>>>0x60 beshort x \b%.4d -# Scripts that run in the embeded Python interpreter +# Scripts that run in the embedded Python interpreter 0 string #!BPY Blender3D BPython script #------------------------------------------------------------------------------ @@ -4957,7 +4957,7 @@ >>>>0 ubelong =0 \b, next free block index %lu >>>>0 ubelong !0 \b, next free block index %lu >>>512 default x dBase IV DBT -# DBF file name without extention +# DBF file name without extension >>>>8 string >\0 \b of %-.8s.DBF # size of blocks ; not reliable 0x2020204C #>>>>4 ulelong =0 \b, blocks size %lu @@ -11969,7 +11969,7 @@ #>65 string ZSYS (Pre-System 7 system file) #>65 string acf3 (Aldus FreeHand) #>65 string cdev (control panel) -#>65 string dfil (Desk Acessory suitcase) +#>65 string dfil (Desk Accessory suitcase) #>65 string libr (library) #>65 string nX^d (WriteNow word processor) #>65 string nX^w (WriteNow dictionary) @@ -13205,7 +13205,7 @@ # they have their real name at offset 22 >>>>>22 string >\0 \b%-.5s >4 uleshort&0x8000 0x0000 -# 32 bit sector adressing ( > 32 MB) for block devices +# 32 bit sector addressing ( > 32 MB) for block devices >>4 uleshort&0x0002 0x0002 \b,32-bit sector- # support by driver functions 13h, 17h, 18h >4 uleshort&0x0040 0x0040 \b,IOCTL- @@ -17951,7 +17951,7 @@ # 00030 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ # 00040 00 00 00 00 ff ff ff ff ff ff ff ff 02 00 00 00 ................ # -# GRR this test is still too general as it catches example adressen.dbt +# GRR this test is still too general as it catches example addressen.dbt 0 belong 0x03000000 >8 ubelong 0xec020000 VMS Alpha executable >>75264 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption diff --git a/ext/fileinfo/tests/resources/test.mp3 b/ext/fileinfo/tests/resources/test.mp3 Binary files differnew file mode 100644 index 000000000..ff6dc3ad7 --- /dev/null +++ b/ext/fileinfo/tests/resources/test.mp3 diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 2aa8dd57d..6496ccdb6 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -241,7 +241,7 @@ PHP_MINIT_FUNCTION(filter) REGISTER_LONG_CONSTANT("FILTER_SANITIZE_STRIPPED", FILTER_SANITIZE_STRING, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_SANITIZE_ENCODED", FILTER_SANITIZE_ENCODED, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_SANITIZE_SPECIAL_CHARS", FILTER_SANITIZE_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FILTER_SANITIZE_FULL_SPECIAL_CHARS", FILTER_SANITIZE_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILTER_SANITIZE_FULL_SPECIAL_CHARS", FILTER_SANITIZE_FULL_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_SANITIZE_EMAIL", FILTER_SANITIZE_EMAIL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_SANITIZE_URL", FILTER_SANITIZE_URL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_SANITIZE_NUMBER_INT", FILTER_SANITIZE_NUMBER_INT, CONST_CS | CONST_PERSISTENT); diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 58d5870c1..14964883c 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -484,10 +484,6 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ } s++; } - - if (*(e - 1) == '.') { - goto bad_url; - } } if ( @@ -718,6 +714,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ if (flags & FILTER_FLAG_NO_RES_RANGE) { if ( (ip[0] == 0) || + (ip[0] == 100 && (ip[1] >= 64 || ip[1] <= 127)) || (ip[0] == 128 && ip[1] == 0) || (ip[0] == 191 && ip[1] == 255) || (ip[0] == 169 && ip[1] == 254) || diff --git a/ext/filter/tests/018.phpt b/ext/filter/tests/018.phpt index af52b2e60..9c73fc3cf 100644 --- a/ext/filter/tests/018.phpt +++ b/ext/filter/tests/018.phpt @@ -15,6 +15,8 @@ var_dump(filter_var("192.168.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE)); var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); var_dump(filter_var("192.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); +var_dump(filter_var("100.0.0.0", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); +var_dump(filter_var("100.127.255.255", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP)); var_dump(filter_var("256.1237.123.1", FILTER_VALIDATE_IP)); var_dump(filter_var("255.255.255.255", FILTER_VALIDATE_IP)); @@ -40,6 +42,8 @@ bool(false) string(12) "192.0.34.166" bool(false) string(9) "192.0.0.1" +bool(false) +bool(false) string(12) "192.0.34.166" bool(false) string(15) "255.255.255.255" diff --git a/ext/filter/tests/bug49510.phpt b/ext/filter/tests/bug49510.phpt index 3f365cc43..340c1ccd6 100644 --- a/ext/filter/tests/bug49510.phpt +++ b/ext/filter/tests/bug49510.phpt @@ -1,5 +1,7 @@ --TEST-- -#49510 boolean validation fails with FILTER_NULL_ON_FAILURE +Bug #49510 boolean validation fails with FILTER_NULL_ON_FAILURE +--SKIPIF-- +<?php if (!extension_loaded("filter")) die("skip"); ?> --FILE-- <?php var_dump(filter_var(false, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); diff --git a/ext/filter/tests/bug64441.phpt b/ext/filter/tests/bug64441.phpt new file mode 100644 index 000000000..149079ec0 --- /dev/null +++ b/ext/filter/tests/bug64441.phpt @@ -0,0 +1,11 @@ +--TEST-- +bug 64441, FILTER_VALIDATE_URL will invalidate a hostname that ended by dot +--SKIPIF-- +<?php if (!extension_loaded("filter")) die("skip"); ?> +--FILE-- +<?php +var_dump(filter_var('http://example.com./', FILTER_VALIDATE_URL)); +var_dump(filter_var('http://example.com/', FILTER_VALIDATE_URL)); +--EXPECT-- +string(20) "http://example.com./" +string(19) "http://example.com/" diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 4c8a94f81..0d6704f9d 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -39,7 +39,7 @@ #ifdef PHP_WIN32 #include <winsock2.h> #elif defined(NETWARE) -#ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), atleast for now */ +#ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), at least for now */ #include <novsock2.h> #else #include <sys/socket.h> @@ -182,6 +182,7 @@ ftp_close(ftpbuf_t *ftp) #if HAVE_OPENSSL_EXT if (ftp->ssl_active) { SSL_shutdown(ftp->ssl_handle); + SSL_free(ftp->ssl_handle); } #endif closesocket(ftp->fd); @@ -297,6 +298,7 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC) if (SSL_connect(ftp->ssl_handle) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL/TLS handshake failed"); SSL_shutdown(ftp->ssl_handle); + SSL_free(ftp->ssl_handle); return 0; } @@ -610,7 +612,7 @@ ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int filenam /* {{{ ftp_alloc */ int -ftp_alloc(ftpbuf_t *ftp, const int size, char **response) +ftp_alloc(ftpbuf_t *ftp, const long size, char **response) { char buffer[64]; @@ -618,8 +620,8 @@ ftp_alloc(ftpbuf_t *ftp, const int size, char **response) return 0; } - snprintf(buffer, sizeof(buffer) - 1, "%d", size); - + snprintf(buffer, sizeof(buffer) - 1, "%ld", size); + if (!ftp_putcmd(ftp, "ALLO", buffer)) { return 0; } @@ -785,7 +787,7 @@ ftp_pasv(ftpbuf_t *ftp, int pasv) /* {{{ ftp_get */ int -ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC) +ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC) { databuf_t *data = NULL; int lastch; @@ -806,11 +808,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, ftp->data = data; if (resumepos > 0) { - if (resumepos > 2147483647) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater than 2147483647 bytes."); - goto bail; - } - snprintf(arg, sizeof(arg), "%u", resumepos); + snprintf(arg, sizeof(arg), "%ld", resumepos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -883,10 +881,10 @@ bail: /* {{{ ftp_put */ int -ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC) +ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC) { databuf_t *data = NULL; - int size; + long size; char *ptr; int ch; char arg[11]; @@ -903,11 +901,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, i ftp->data = data; if (startpos > 0) { - if (startpos > 2147483647) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater than 2147483647 bytes."); - goto bail; - } - snprintf(arg, sizeof(arg), "%u", startpos); + snprintf(arg, sizeof(arg), "%ld", startpos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -964,7 +958,7 @@ bail: /* {{{ ftp_size */ -int +long ftp_size(ftpbuf_t *ftp, const char *path) { if (ftp == NULL) { @@ -979,7 +973,7 @@ ftp_size(ftpbuf_t *ftp, const char *path) if (!ftp_getresp(ftp) || ftp->resp != 213) { return -1; } - return atoi(ftp->inbuf); + return atol(ftp->inbuf); } /* }}} */ @@ -1141,7 +1135,7 @@ ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args) int ftp_readline(ftpbuf_t *ftp) { - int size, rcvd; + long size, rcvd; char *data, *eol; /* shift the extra to the front */ @@ -1234,7 +1228,8 @@ ftp_getresp(ftpbuf_t *ftp) int my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { - int n, size, sent; + long size, sent; + int n; size = len; while (size) { @@ -1548,6 +1543,7 @@ data_accepted: if (SSL_connect(data->ssl_handle) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: SSL/TLS handshake failed"); SSL_shutdown(data->ssl_handle); + SSL_free(data->ssl_handle); return 0; } @@ -1565,13 +1561,21 @@ data_accepted: databuf_t* data_close(ftpbuf_t *ftp, databuf_t *data) { +#if HAVE_OPENSSL_EXT + SSL_CTX *ctx; +#endif if (data == NULL) { return NULL; } if (data->listener != -1) { #if HAVE_OPENSSL_EXT if (data->ssl_active) { + + ctx = SSL_get_SSL_CTX(data->ssl_handle); + SSL_CTX_free(ctx); + SSL_shutdown(data->ssl_handle); + SSL_free(data->ssl_handle); data->ssl_active = 0; } #endif @@ -1580,7 +1584,11 @@ data_close(ftpbuf_t *ftp, databuf_t *data) if (data->fd != -1) { #if HAVE_OPENSSL_EXT if (data->ssl_active) { + ctx = SSL_get_SSL_CTX(data->ssl_handle); + SSL_CTX_free(ctx); + SSL_shutdown(data->ssl_handle); + SSL_free(data->ssl_handle); data->ssl_active = 0; } #endif @@ -1704,7 +1712,7 @@ bail: /* {{{ ftp_nb_get */ int -ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC) +ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC) { databuf_t *data = NULL; char arg[11]; @@ -1722,14 +1730,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ } if (resumepos>0) { - /* We are working on an architecture that supports 64-bit integers - * since php is 32 bit by design, we bail out with warning - */ - if (resumepos > 2147483647) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater than 2147483648 bytes."); - goto bail; - } - snprintf(arg, sizeof(arg), "%u", resumepos); + snprintf(arg, sizeof(arg), "%ld", resumepos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -1828,7 +1829,7 @@ bail: /* {{{ ftp_nb_put */ int -ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC) +ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC) { databuf_t *data = NULL; char arg[11]; @@ -1843,11 +1844,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type goto bail; } if (startpos > 0) { - if (startpos > 2147483647) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater than 2147483647 bytes."); - goto bail; - } - snprintf(arg, sizeof(arg), "%u", startpos); + snprintf(arg, sizeof(arg), "%ld", startpos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -1884,7 +1881,7 @@ bail: int ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC) { - int size; + long size; char *ptr; int ch; diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h index c7db45789..69de7dbb7 100644 --- a/ext/ftp/ftp.h +++ b/ext/ftp/ftp.h @@ -146,7 +146,7 @@ int ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int fi * however some servers will not accept STOR or APPE until ALLO is confirmed. * If response is passed, it is estrdup()ed from ftp->inbuf and must be freed * or assigned to a zval returned to the user */ -int ftp_alloc(ftpbuf_t *ftp, const int size, char **response); +int ftp_alloc(ftpbuf_t *ftp, const long size, char **response); /* returns a NULL-terminated array of filenames in the given path * or NULL on error. the return array must be freed (but don't @@ -169,15 +169,15 @@ int ftp_pasv(ftpbuf_t *ftp, int pasv); /* retrieves a file and saves its contents to outfp * returns true on success, false on error */ -int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC); +int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC); /* stores the data from a file, socket, or process as a file on the remote server * returns true on success, false on error */ -int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC); +int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC); /* returns the size of the given file, or -1 on error */ -int ftp_size(ftpbuf_t *ftp, const char *path); +long ftp_size(ftpbuf_t *ftp, const char *path); /* returns the last modified time of the given file, or -1 on error */ time_t ftp_mdtm(ftpbuf_t *ftp, const char *path); @@ -194,12 +194,12 @@ int ftp_site(ftpbuf_t *ftp, const char *cmd); /* retrieves part of a file and saves its contents to outfp * returns true on success, false on error */ -int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC); +int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC); /* stores the data from a file, socket, or process as a file on the remote server * returns true on success, false on error */ -int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC); +int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC); /* continues a previous nb_(f)get command */ diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 73071936e..da22e0b63 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -784,8 +784,8 @@ PHP_FUNCTION(ftp_nb_fget) ftptype_t xtype; php_stream *stream; char *file; - int file_len, ret; - long mode, resumepos=0; + int file_len; + long mode, resumepos=0, ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) { return; @@ -968,9 +968,7 @@ PHP_FUNCTION(ftp_nb_get) RETURN_LONG(PHP_FTP_FAILED); } - if (ret == PHP_FTP_FINISHED) { - php_stream_close(outstream); - } + php_stream_close(outstream); RETURN_LONG(ret); } @@ -982,7 +980,7 @@ PHP_FUNCTION(ftp_nb_continue) { zval *z_ftp; ftpbuf_t *ftp; - int ret; + long ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { return; @@ -1120,7 +1118,7 @@ PHP_FUNCTION(ftp_put) ftpbuf_t *ftp; ftptype_t xtype; char *remote, *local; - int remote_len, local_len; + long remote_len, local_len; long mode, startpos=0; php_stream *instream; @@ -1173,8 +1171,8 @@ PHP_FUNCTION(ftp_nb_put) ftpbuf_t *ftp; ftptype_t xtype; char *remote, *local; - int remote_len, local_len, ret; - long mode, startpos=0; + int remote_len, local_len; + long mode, startpos=0, ret; php_stream *instream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) { diff --git a/ext/ftp/tests/filesize_large.phpt b/ext/ftp/tests/filesize_large.phpt new file mode 100644 index 000000000..05f12a3e5 --- /dev/null +++ b/ext/ftp/tests/filesize_large.phpt @@ -0,0 +1,23 @@ +--TEST-- +Verify php can handle filesizes >32bit +--SKIPIF-- +<?php +require 'skipif.inc'; +if (2147483647 == PHP_INT_MAX) { + die('skip 64-bit only'); +} +?> +--FILE-- +<?php +require 'server.inc'; + +$ftp = ftp_connect('127.0.0.1', $port); +if (!$ftp) die("Couldn't connect to the server"); + +ftp_login($ftp, 'user', 'pass'); +var_dump(ftp_size($ftp, 'largefile')); + +ftp_close($ftp); +?> +--EXPECT-- +int(5368709120) diff --git a/ext/ftp/tests/ftp_fget_basic.phpt b/ext/ftp/tests/ftp_fget_basic.phpt index d736f8c45..355b8b846 100644 --- a/ext/ftp/tests/ftp_fget_basic.phpt +++ b/ext/ftp/tests/ftp_fget_basic.phpt @@ -27,7 +27,7 @@ var_dump(ftp_fget($ftp, $fp, 'binary data.bin', FTP_BINARY)); fseek($fp, $postition); var_dump(urlencode(fgets($fp))); -//test non-existant file request +//test non-existent file request ftp_fget($ftp, $fp ,'a warning.txt', FTP_ASCII); //remove file diff --git a/ext/ftp/tests/ftp_get_basic.phpt b/ext/ftp/tests/ftp_get_basic.phpt index 23fd8d07f..2fd8c7914 100644 --- a/ext/ftp/tests/ftp_get_basic.phpt +++ b/ext/ftp/tests/ftp_get_basic.phpt @@ -27,7 +27,7 @@ var_dump(ftp_get($ftp, $tmpfname, 'binary data.bin', FTP_BINARY)); var_dump(urlencode(file_get_contents($tmpfname))); unlink($tmpfname); -//test non-existant file request +//test non-existent file request ftp_get($ftp, $tmpfname ,'a warning.txt', FTP_ASCII); ?> --EXPECTF-- diff --git a/ext/ftp/tests/ftp_nb_get_large.phpt b/ext/ftp/tests/ftp_nb_get_large.phpt new file mode 100644 index 000000000..3fbf2a483 --- /dev/null +++ b/ext/ftp/tests/ftp_nb_get_large.phpt @@ -0,0 +1,36 @@ +--TEST-- +Testing ftp_nb_fget can handle large files incl. resume +--SKIPIF-- +<?php +require 'skipif.inc'; +if (2147483647 == PHP_INT_MAX) { + die('skip ot supported on this system'); +} +if (disk_free_space(__DIR__) < 10*1024*1024*1024) { + die('not enough disk space'); +} +?> +--FILE-- +<?php +require 'server.inc'; + +$ftp = ftp_connect('127.0.0.1', $port); +ftp_login($ftp, 'user', 'pass'); +if (!$ftp) die("Couldn't connect to the server"); + +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +touch($local_file); +ftp_nb_get($ftp, $local_file, 'fget_large.txt', FTP_BINARY, 5368709119); +$fp = fopen($local_file, 'r'); +fseek($fp, 5368709119); +var_dump(fread($fp, 1)); +var_dump(filesize($local_file)); +fclose($fp); +?> +--CLEAN-- +<?php +@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"); +?> +--EXPECT-- +string(1) "X" +int(5368709120) diff --git a/ext/ftp/tests/server.inc b/ext/ftp/tests/server.inc index 861788062..7dc8fa08d 100644 --- a/ext/ftp/tests/server.inc +++ b/ext/ftp/tests/server.inc @@ -357,7 +357,17 @@ if ($pid) { $transfer_type = $ascii? 'ASCII' : 'BINARY' ; fputs($fs, "Bar\r\n"); fputs($s, "226 Closing data Connection.\r\n"); - break; + break; + case "fget_large": + fputs($s, "150 File status okay; about to open data connection.\r\n"); + $transfer_type = $ascii? 'ASCII' : 'BINARY' ; + if ($GLOBALS['rest_pos'] == '5368709119') { + fputs($fs, "X"); + } else { + fputs($fs, "Y"); + } + fputs($s, "226 Closing data Connection.\r\n"); + break; default: fputs($s, "550 {$matches[1]}: No such file or directory \r\n"); break; @@ -393,11 +403,12 @@ if ($pid) { }elseif (preg_match('/^LIST no_exists\//', $buf, $matches)) { fputs($s, "425 Error establishing connection\r\n"); - }elseif (preg_match('/^REST \d+/', $buf, $matches)) { + }elseif (preg_match('/^REST (\d+)/', $buf, $matches)) { + $GLOBALS['rest_pos'] = $matches[1]; fputs($s, "350 OK\r\n"); - } - - else { + }elseif (preg_match('/^SIZE largefile/', $buf)) { + fputs($s, "213 5368709120\r\n"); + }else { fputs($s, "500 Syntax error, command unrecognized.\r\n"); dump_and_exit($buf); } @@ -407,4 +418,4 @@ if ($pid) { } fclose($socket); -?>
\ No newline at end of file +?> diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 87e889345..3279463b7 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -129,7 +129,7 @@ int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b); /* IMPORTANT NOTE FOR NEW FILTER * Do not forget to update: * IMAGE_FILTER_MAX: define the last filter index - * IMAGE_FILTER_MAX_ARGS: define the biggest amout of arguments + * IMAGE_FILTER_MAX_ARGS: define the biggest amount of arguments * image_filter array in PHP_FUNCTION(imagefilter) * */ #define IMAGE_FILTER_NEGATE 0 diff --git a/ext/gd/libgd/webpimg.h b/ext/gd/libgd/webpimg.h index 8a05429a7..db23de5bb 100644 --- a/ext/gd/libgd/webpimg.h +++ b/ext/gd/libgd/webpimg.h @@ -84,7 +84,7 @@ WebPResult WebPDecode(const uint8* data, * height. * 6. y_stride: The width (in bytes) of one row of Y data. This may not * match width if there is end of row padding (e.g., for 32 - * bit row aligment). + * bit row alignment). * 7. QP: the quantization parameter. This parameter controls the * compression vs quality tradeoff. Use smaller numbers for better * quality (compression will be lesser) and vice versa. 20 is a diff --git a/ext/gd/tests/imagecopyresampled_basic.phpt b/ext/gd/tests/imagecopyresampled_basic.phpt index a0454faf8..fd96ab692 100644 --- a/ext/gd/tests/imagecopyresampled_basic.phpt +++ b/ext/gd/tests/imagecopyresampled_basic.phpt @@ -35,9 +35,9 @@ imagefilledellipse($image_lge, 200, 150, 300, 200, $col_ellipse); imagepng($image_lge, $dest_lge); // Get new dimensions -$percent = 0.5; // new image 50% of orginal +$percent = 0.5; // new image 50% of original list($width, $height) = getimagesize($dest_lge); -echo "Size of orginal: width=". $width . " height=" . $height . "\n"; +echo "Size of original: width=". $width . " height=" . $height . "\n"; $new_width = $width * $percent; $new_height = $height * $percent; @@ -66,6 +66,6 @@ echo "Done\n"; ?> --EXPECT-- Simple test of imagecopyresampled() function -Size of orginal: width=400 height=300 +Size of original: width=400 height=300 Size of copy: width=200 height=150 Done diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index c9da09b23..e3a3563aa 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -1069,7 +1069,7 @@ ZEND_FUNCTION(gmp_powm) zval **base_arg, **exp_arg, **mod_arg; mpz_t *gmpnum_base, *gmpnum_exp, *gmpnum_mod, *gmpnum_result; int use_ui = 0; - int temp_base, temp_exp, temp_mod; + int temp_base = 0, temp_exp = 0, temp_mod; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ", &base_arg, &exp_arg, &mod_arg) == FAILURE){ return; @@ -1333,6 +1333,7 @@ ZEND_FUNCTION(gmp_cmp) res = mpz_cmp_si(*gmpnum_a, Z_LVAL_PP(b_arg)); } else { res = mpz_cmp(*gmpnum_a, *gmpnum_b); + FREE_GMP_TEMP(temp_b); } FREE_GMP_TEMP(temp_a); diff --git a/ext/hash/tests/hash_file_error.phpt b/ext/hash/tests/hash_file_error.phpt index 326fbd51a..de7ce55b1 100644 --- a/ext/hash/tests/hash_file_error.phpt +++ b/ext/hash/tests/hash_file_error.phpt @@ -23,8 +23,8 @@ file_put_contents( $filename, 'The quick brown fox jumped over the lazy dog.' ); echo "\n-- Testing hash_file() function with an unknown algorithm --\n"; var_dump( hash_file( 'foobar', $filename ) ); -echo "\n-- Testing hash_file() function with a non-existant file --\n"; -var_dump( hash_file( 'md5', 'nonexistant.txt' ) ); +echo "\n-- Testing hash_file() function with a non-existent file --\n"; +var_dump( hash_file( 'md5', 'nonexistent.txt' ) ); echo "\n-- Testing hash_file() function with less than expected no. of arguments --\n"; var_dump( hash_file( 'md5' ) ); @@ -50,7 +50,7 @@ unlink( $filename ); Warning: hash_file(): Unknown hashing algorithm: %s in %s on line %d bool(false) --- Testing hash_file() function with a non-existant file -- +-- Testing hash_file() function with a non-existent file -- Warning: hash_file(%s): failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/hash/tests/mhash_002.phpt b/ext/hash/tests/mhash_002.phpt index 7bcafd389..45cf09fb7 100644 --- a/ext/hash/tests/mhash_002.phpt +++ b/ext/hash/tests/mhash_002.phpt @@ -24,7 +24,7 @@ $supported_hash_al = array( "CRC32" => 4, "CRC32B" => 4, "ADLER32" => 4, -"NA_XYZ" => 0 /* verify that the algorythm works */ +"NA_XYZ" => 0 /* verify that the algorithm works */ ); $hc = mhash_count() + 1; diff --git a/ext/imap/config.m4 b/ext/imap/config.m4 index 3ad7c107d..3fcf6742d 100644 --- a/ext/imap/config.m4 +++ b/ext/imap/config.m4 @@ -198,9 +198,9 @@ if test "$PHP_IMAP" != "no"; then AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.) fi - if test -r "$IMAP_DIR/c-client/c-client.a"; then + if test ! -r "$IMAP_DIR/c-client/libc-client.a" && test -r "$IMAP_DIR/c-client/c-client.a" ; then ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1 - elif test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then + elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1 fi diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index b154cb86b..d697fa791 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1270,7 +1270,6 @@ PHP_FUNCTION(imap_reopen) int mailbox_len; long options = 0, retries = 0; pils *imap_le_struct; - MAILSTREAM *imap_stream; long flags=NIL; long cl_flags=NIL; @@ -1298,12 +1297,12 @@ PHP_FUNCTION(imap_reopen) RETURN_FALSE; } - imap_stream = mail_open(imap_le_struct->imap_stream, mailbox, flags); - if (imap_stream == NIL) { + imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, mailbox, flags); + if (imap_le_struct->imap_stream == NIL) { + zend_list_delete(Z_RESVAL_P(streamind)); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't re-open stream"); RETURN_FALSE; } - imap_le_struct->imap_stream = imap_stream; RETURN_TRUE; } /* }}} */ diff --git a/ext/imap/tests/imap_include.inc b/ext/imap/tests/imap_include.inc index ed3623957..b33a10e5e 100644 --- a/ext/imap/tests/imap_include.inc +++ b/ext/imap/tests/imap_include.inc @@ -61,7 +61,7 @@ function displayOverviewFields($resp, $fields=null) { * @param string mailbox_suffix Suffix used to uniquely identify mailboxes * @param int message_count number of test msgs to be written to new mailbox * - * @return IMAP stream to new mailbox on sucesss; FALSE on failure + * @return IMAP stream to new mailbox on success; FALSE on failure */ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){ global $server, $default_mailbox, $username, $password; diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt index 5b16ac291..c5167c132 100644 --- a/ext/interbase/tests/005.phpt +++ b/ext/interbase/tests/005.phpt @@ -18,7 +18,7 @@ InterBase: transactions /* Difference between default and other transactions: -default commited when you call ibase_close(). +default committed when you call ibase_close(). Other transaction doing rollback. If you not open default transaction with @@ -158,7 +158,7 @@ three transaction on default link ibase_free_result($res); - /* tr_4 IBASE_COMMITED + IBASE_REC_NO_VERSION + IBASE_NOWAIT */ + /* tr_4 IBASE_COMMITTED + IBASE_REC_NO_VERSION + IBASE_NOWAIT */ $res = ibase_query($tr_4, "select * from test5"); echo "three rows in fourth transaction with deadlock\n"; diff --git a/ext/intl/doc/Tutorial.txt b/ext/intl/doc/Tutorial.txt index 4a66dc184..3bb31b00e 100644 --- a/ext/intl/doc/Tutorial.txt +++ b/ext/intl/doc/Tutorial.txt @@ -7,7 +7,7 @@ Examle of locales format: 'en_US', 'ru_UA', 'ua_UA' (see http://demo.icu-project 2. Collator::getDisplayName( $obj_locale, $disp_locale ). -Get name of the object for the desired Locale, in the desired langauge. Both arguments +Get name of the object for the desired Locale, in the desired language. Both arguments must be from getAvailableLocales method. @param string $obj_locale Locale to get display name for. diff --git a/ext/intl/doc/grapheme_api.php b/ext/intl/doc/grapheme_api.php index 465453fd3..e22d165cb 100644 --- a/ext/intl/doc/grapheme_api.php +++ b/ext/intl/doc/grapheme_api.php @@ -98,7 +98,7 @@ * @param string $haystack The input string. * @param string $needle The string to look for. * @param [boolean] $before_needle If TRUE (the default is FALSE), grapheme_strstr() returns the part of the - haystack before the first occurence of the needle. + haystack before the first occurrence of the needle. * @return string Returns the portion of string, or FALSE if needle is not found. */ function grapheme_strstr($haystack, $needle, $before_needle = FALSE) {} @@ -109,7 +109,7 @@ * @param string $haystack The input string. * @param string $needle The string to look for. * @param [boolean] $before_needle If TRUE (the default is FALSE), grapheme_strstr() returns the part of the - haystack before the first occurence of the needle. + haystack before the first occurrence of the needle. * @return string Returns the portion of string, or FALSE if needle is not found. */ function grapheme_stristr($haystack, $needle, $before_needle = FALSE) {} diff --git a/ext/intl/doc/msgfmt_api.php b/ext/intl/doc/msgfmt_api.php index e4d047b97..3df6f0de1 100644 --- a/ext/intl/doc/msgfmt_api.php +++ b/ext/intl/doc/msgfmt_api.php @@ -31,7 +31,7 @@ class MessageFormatter { /** * Format the message * @param array $args arguments to insert into the pattern string - * @return string the formatted string, or false if an error ocurred + * @return string the formatted string, or false if an error occurred */ public function format($args) {} @@ -124,7 +124,7 @@ class MessageFormatter { * Format the message * @param MessageFormatter $fmt The message formatter * @param array $args arguments to insert into the pattern string - * @return string the formatted string, or false if an error ocurred + * @return string the formatted string, or false if an error occurred */ function msgfmt_format($fmt, $args) {} diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 475bbe418..8a094e015 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -113,7 +113,7 @@ PHP_FUNCTION(grapheme_strpos) unsigned char *found; long loffset = 0; int32_t offset = 0; - int ret_pos, uchar_pos; + int ret_pos; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { @@ -160,10 +160,10 @@ PHP_FUNCTION(grapheme_strpos) } /* do utf16 part of the strpos */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, &uchar_pos, 0 /* fIgnoreCase */ TSRMLS_CC ); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0 /* last */ TSRMLS_CC ); if ( ret_pos >= 0 ) { - RETURN_LONG(ret_pos + offset); + RETURN_LONG(ret_pos); } else { RETURN_FALSE; } @@ -180,7 +180,7 @@ PHP_FUNCTION(grapheme_stripos) unsigned char *found; long loffset = 0; int32_t offset = 0; - int ret_pos, uchar_pos; + int ret_pos; int is_ascii; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { @@ -235,10 +235,10 @@ PHP_FUNCTION(grapheme_stripos) } /* do utf16 part of the strpos */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, &uchar_pos, 1 /* fIgnoreCase */ TSRMLS_CC ); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* fIgnoreCase */, 0 /*last */ TSRMLS_CC ); if ( ret_pos >= 0 ) { - RETURN_LONG(ret_pos + offset); + RETURN_LONG(ret_pos); } else { RETURN_FALSE; } @@ -304,7 +304,7 @@ PHP_FUNCTION(grapheme_strrpos) /* else we need to continue via utf16 */ } - ret_pos = grapheme_strrpos_utf16(haystack, haystack_len, needle, needle_len, offset, 0 /* f_ignore_case */ TSRMLS_CC); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* f_ignore_case */, 1/* last */ TSRMLS_CC); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -382,7 +382,7 @@ PHP_FUNCTION(grapheme_strripos) /* else we need to continue via utf16 */ } - ret_pos = grapheme_strrpos_utf16(haystack, haystack_len, needle, needle_len, offset, 1 /* f_ignore_case */ TSRMLS_CC); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* f_ignore_case */, 1 /*last */ TSRMLS_CC); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -434,6 +434,7 @@ PHP_FUNCTION(grapheme_substr) grapheme_substr_ascii((char *)str, str_len, start, length, ZEND_NUM_ARGS(), (char **) &sub_str, &sub_str_len); if ( NULL == sub_str ) { + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: invalid parameters", 1 TSRMLS_CC ); RETURN_FALSE; } @@ -530,6 +531,15 @@ PHP_FUNCTION(grapheme_substr) RETURN_STRINGL(((char *)sub_str), sub_str_len, 0); } + if(length == 0) { + /* empty length - we've validated start, we can return "" now */ + if (ustr) { + efree(ustr); + } + ubrk_close(bi); + RETURN_EMPTY_STRING(); + } + /* find the end point of the string to return */ if ( length < 0 ) { @@ -554,25 +564,31 @@ PHP_FUNCTION(grapheme_substr) length += iter_val; } + ubrk_close(bi); + if ( UBRK_DONE == sub_str_end_pos) { if(length < 0) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length not contained in string", 1 TSRMLS_CC ); efree(ustr); - ubrk_close(bi); RETURN_FALSE; } else { sub_str_end_pos = ustr_len; } } + + if(sub_str_start_pos > sub_str_end_pos) { + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length is beyond start", 1 TSRMLS_CC ); + + efree(ustr); + RETURN_FALSE; + } sub_str = NULL; status = U_ZERO_ERROR; intl_convert_utf16_to_utf8((char **)&sub_str, &sub_str_len, ustr + sub_str_start_pos, ( sub_str_end_pos - sub_str_start_pos ), &status); efree( ustr ); - ubrk_close( bi ); if ( U_FAILURE( status ) ) { /* Set global error code. */ @@ -643,7 +659,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas } /* need to work in utf16 */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case TSRMLS_CC ); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case, 0 /*last */ TSRMLS_CC ); if ( ret_pos < 0 ) { RETURN_FALSE; diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c index 92008554d..c752b0237 100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.c @@ -28,6 +28,7 @@ #include <unicode/ucol.h> #include <unicode/ustring.h> #include <unicode/ubrk.h> +#include <unicode/usearch.h> #include "ext/standard/php_string.h" @@ -47,49 +48,8 @@ grapheme_close_global_iterator( TSRMLS_D ) } /* }}} */ -/* {{{ grapheme_intl_case_fold: convert string to lowercase */ -void -grapheme_intl_case_fold(UChar** ptr_to_free, UChar **str, int32_t *str_len, UErrorCode *pstatus ) -{ - UChar *dest; - int32_t dest_len, size_required; - - /* allocate a destination string that is a bit larger than the src, hoping that is enough */ - dest_len = (*str_len) + ( *str_len / 10 ); - dest = (UChar*) eumalloc(dest_len); - - *pstatus = U_ZERO_ERROR; - size_required = u_strFoldCase(dest, dest_len, *str, *str_len, U_FOLD_CASE_DEFAULT, pstatus); - - dest_len = size_required; - - if ( U_BUFFER_OVERFLOW_ERROR == *pstatus ) { - - dest = (UChar*) eurealloc(dest, dest_len); - - *pstatus = U_ZERO_ERROR; - size_required = u_strFoldCase(dest, dest_len, *str, *str_len, U_FOLD_CASE_DEFAULT, pstatus); - } - - if ( U_FAILURE(*pstatus) ) { - return; - } - - if ( NULL != ptr_to_free) { - efree(*ptr_to_free); - *ptr_to_free = dest; - } - - *str = dest; - *str_len = dest_len; - - return; -} -/* }}} */ - /* {{{ grapheme_substr_ascii f='from' - starting point, l='length' */ -void -grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char **sub_str, int *sub_str_len) +void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char **sub_str, int *sub_str_len) { *sub_str = NULL; @@ -147,225 +107,101 @@ grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char **sub } /* }}} */ -/* {{{ grapheme_strrpos_utf16 - strrpos using utf16 */ -int -grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case TSRMLS_DC) -{ - UChar *uhaystack, *puhaystack, *uhaystack_end, *uneedle; - int32_t uhaystack_len, uneedle_len; - UErrorCode status; - unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE]; - UBreakIterator* bi = NULL; - int ret_pos, pos; - - /* convert the strings to UTF-16. */ - uhaystack = NULL; - uhaystack_len = 0; - status = U_ZERO_ERROR; - intl_convert_utf8_to_utf16(&uhaystack, &uhaystack_len, (char *) haystack, haystack_len, &status ); - - if ( U_FAILURE( status ) ) { - /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); - - /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); - if (uhaystack) { - efree( uhaystack ); - } - return -1; - } - - if ( f_ignore_case ) { - grapheme_intl_case_fold(&uhaystack, &uhaystack, &uhaystack_len, &status ); - } - - /* get a pointer to the haystack taking into account the offset */ - bi = NULL; - status = U_ZERO_ERROR; - bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status TSRMLS_CC ); - - puhaystack = grapheme_get_haystack_offset(bi, uhaystack, uhaystack_len, offset); - - if ( NULL == puhaystack ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC ); - if (uhaystack) { - efree( uhaystack ); - } - ubrk_close (bi); - return -1; - } - - uneedle = NULL; - uneedle_len = 0; - status = U_ZERO_ERROR; - intl_convert_utf8_to_utf16(&uneedle, &uneedle_len, (char *) needle, needle_len, &status ); - - if ( U_FAILURE( status ) ) { - /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); - - /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); - if (uhaystack) { - efree( uhaystack ); - } - if (uneedle) { - efree( uneedle ); - } - ubrk_close (bi); - return -1; - } - - if ( f_ignore_case ) { - grapheme_intl_case_fold(&uneedle, &uneedle, &uneedle_len, &status ); - } - - ret_pos = -1; /* -1 represents 'not found' */ - - /* back up until there's needle_len characters to compare */ - - uhaystack_end = uhaystack + uhaystack_len; - pos = ubrk_last(bi); - puhaystack = uhaystack + pos; - - while ( uhaystack_end - puhaystack < uneedle_len ) { - - pos = ubrk_previous(bi); - - if ( UBRK_DONE == pos ) { - break; - } - - puhaystack = uhaystack + pos; - } - - /* is there enough haystack left to hold the needle? */ - if ( ( uhaystack_end - puhaystack ) < uneedle_len ) { - /* not enough, not found */ - goto exit; - } - - while ( UBRK_DONE != pos ) { - - if (!u_memcmp(uneedle, puhaystack, uneedle_len)) { /* needle_len - 1 in zend memnstr? */ - - /* does the grapheme in the haystack end at the same place as the last grapheme in the needle? */ - - if ( ubrk_isBoundary(bi, pos + uneedle_len) ) { - - /* found it, get grapheme count offset */ - ret_pos = grapheme_count_graphemes(bi, uhaystack, pos); - break; - } - - /* set position back */ - ubrk_isBoundary(bi, pos); - } - - pos = ubrk_previous(bi); - puhaystack = uhaystack + pos; - } - -exit: - if (uhaystack) { - efree( uhaystack ); - } - if (uneedle) { - efree( uneedle ); +#define STRPOS_CHECK_STATUS(status, error) \ + if ( U_FAILURE( (status) ) ) { \ + intl_error_set_code( NULL, (status) TSRMLS_CC ); \ + intl_error_set_custom_msg( NULL, (error), 0 TSRMLS_CC ); \ + if (uhaystack) { \ + efree( uhaystack ); \ + } \ + if (uneedle) { \ + efree( uneedle ); \ + } \ + if(bi) { \ + ubrk_close (bi); \ + } \ + if(src) { \ + usearch_close(src); \ + } \ + return -1; \ } - ubrk_close (bi); - - return ret_pos; -} -/* }}} */ /* {{{ grapheme_strpos_utf16 - strrpos using utf16*/ -int -grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case TSRMLS_DC) +int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last TSRMLS_DC) { - UChar *uhaystack, *puhaystack, *uneedle; - int32_t uhaystack_len, uneedle_len; - int ret_pos; + UChar *uhaystack = NULL, *uneedle = NULL; + int32_t uhaystack_len = 0, uneedle_len = 0, char_pos, ret_pos, offset_pos = 0; unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE]; - UBreakIterator* bi; + UBreakIterator* bi = NULL; UErrorCode status; + UStringSearch* src = NULL; + UCollator *coll; - *puchar_pos = -1; - + if(puchar_pos) { + *puchar_pos = -1; + } /* convert the strings to UTF-16. */ - uhaystack = NULL; - uhaystack_len = 0; status = U_ZERO_ERROR; intl_convert_utf8_to_utf16(&uhaystack, &uhaystack_len, (char *) haystack, haystack_len, &status ); + STRPOS_CHECK_STATUS(status, "Error converting input string to UTF-16"); - if ( U_FAILURE( status ) ) { - /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); - - /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); - if (uhaystack) { - efree( uhaystack ); - } - return -1; - } + status = U_ZERO_ERROR; + intl_convert_utf8_to_utf16(&uneedle, &uneedle_len, (char *) needle, needle_len, &status ); + STRPOS_CHECK_STATUS(status, "Error converting input string to UTF-16"); /* get a pointer to the haystack taking into account the offset */ - bi = NULL; status = U_ZERO_ERROR; bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status TSRMLS_CC ); - - puhaystack = grapheme_get_haystack_offset(bi, uhaystack, uhaystack_len, offset); - uhaystack_len = (uhaystack_len - ( puhaystack - uhaystack)); + STRPOS_CHECK_STATUS(status, "Failed to get iterator"); + status = U_ZERO_ERROR; + ubrk_setText(bi, uhaystack, uhaystack_len, &status); + STRPOS_CHECK_STATUS(status, "Failed to set up iterator"); - if ( NULL == puhaystack ) { - - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC ); - if (uhaystack) { - efree( uhaystack ); - } - ubrk_close (bi); - - return -1; - } + status = U_ZERO_ERROR; + src = usearch_open(uneedle, uneedle_len, uhaystack, uhaystack_len, "", bi, &status); + STRPOS_CHECK_STATUS(status, "Error creating search object"); - if ( f_ignore_case ) { - grapheme_intl_case_fold(&uhaystack, &puhaystack, &uhaystack_len, &status ); + if(f_ignore_case) { + coll = usearch_getCollator(src); + status = U_ZERO_ERROR; + ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_SECONDARY, &status); + STRPOS_CHECK_STATUS(status, "Error setting collation strength"); + usearch_reset(src); } - uneedle = NULL; - uneedle_len = 0; - status = U_ZERO_ERROR; - intl_convert_utf8_to_utf16(&uneedle, &uneedle_len, (char *) needle, needle_len, &status ); + if(offset != 0) { + offset_pos = grapheme_get_haystack_offset(bi, offset); + if(offset_pos == -1) { + status = U_ILLEGAL_ARGUMENT_ERROR; + STRPOS_CHECK_STATUS(status, "Invalid search offset"); + } + status = U_ZERO_ERROR; + usearch_setOffset(src, offset_pos, &status); + STRPOS_CHECK_STATUS(status, "Invalid search offset"); + } - if ( U_FAILURE( status ) ) { - /* Set global error code. */ - intl_error_set_code( NULL, status TSRMLS_CC ); - /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); - if (uhaystack) { - efree( uhaystack ); + if(last) { + char_pos = usearch_last(src, &status); + if(char_pos < offset_pos) { + /* last one is beyound our start offset */ + char_pos = USEARCH_DONE; } - if (uneedle) { - efree( uneedle ); - } - ubrk_close (bi); - - return -1; + } else { + char_pos = usearch_next(src, &status); } - - if ( f_ignore_case ) { - grapheme_intl_case_fold(&uneedle, &uneedle, &uneedle_len, &status ); + STRPOS_CHECK_STATUS(status, "Error looking up string"); + if(char_pos != USEARCH_DONE && ubrk_isBoundary(bi, char_pos)) { + ret_pos = grapheme_count_graphemes(bi, uhaystack,char_pos); + if(puchar_pos) { + *puchar_pos = char_pos; + } + } else { + ret_pos = -1; } - ret_pos = grapheme_memnstr_grapheme(bi, puhaystack, uneedle, uneedle_len, puhaystack + uhaystack_len ); - - *puchar_pos = ubrk_current(bi); - if (uhaystack) { efree( uhaystack ); } @@ -373,6 +209,7 @@ grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned ch efree( uneedle ); } ubrk_close (bi); + usearch_close (src); return ret_pos; } @@ -432,8 +269,7 @@ int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_a /* }}} */ /* {{{ grapheme_count_graphemes */ -int32_t -grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len) +int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len) { int ret_len = 0; int pos = 0; @@ -455,85 +291,16 @@ grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len) } /* }}} */ -/* {{{ grapheme_memnstr_grapheme: find needle in haystack using grapheme boundaries */ -int32_t -grapheme_memnstr_grapheme(UBreakIterator *bi, UChar *haystack, UChar *needle, int32_t needle_len, UChar *end) -{ - UChar *p = haystack; - UChar ne = needle[needle_len-1]; - UErrorCode status; - int32_t grapheme_offset; - - end -= needle_len; - - while (p <= end) { - - if ((p = u_memchr(p, *needle, (end-p+1))) && ne == p[needle_len-1]) { - - if (!u_memcmp(needle, p, needle_len - 1)) { /* needle_len - 1 works because if needle_len is 1, we've already tested the char */ - - /* does the grapheme end here? */ - - status = U_ZERO_ERROR; - ubrk_setText (bi, haystack, (end - haystack) + needle_len, &status); - - if ( ubrk_isBoundary (bi, (p - haystack) + needle_len) ) { - - /* found it, get grapheme count offset */ - grapheme_offset = grapheme_count_graphemes(bi, haystack, (p - haystack)); - - return grapheme_offset; - } - } - } - - if (p == NULL) { - return -1; - } - - p++; - } - - return -1; -} - -/* }}} */ - -/* {{{ grapheme_memrstr_grapheme: reverse find needle in haystack using grapheme boundaries */ -inline void *grapheme_memrchr_grapheme(const void *s, int c, int32_t n) -{ - register unsigned char *e; - - if (n <= 0) { - return NULL; - } - - for (e = (unsigned char *)s + n - 1; e >= (unsigned char *)s; e--) { - if (*e == (unsigned char)c) { - return (void *)e; - } - } - - return NULL; -} -/* }}} */ /* {{{ grapheme_get_haystack_offset - bump the haystack pointer based on the grapheme count offset */ -UChar * -grapheme_get_haystack_offset(UBreakIterator* bi, UChar *uhaystack, int32_t uhaystack_len, int32_t offset) +int grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset) { - UErrorCode status; int32_t pos; int32_t (*iter_op)(UBreakIterator* bi); int iter_incr; - if ( NULL != bi ) { - status = U_ZERO_ERROR; - ubrk_setText (bi, uhaystack, uhaystack_len, &status); - } - if ( 0 == offset ) { - return uhaystack; + return 0; } if ( offset < 0 ) { @@ -558,10 +325,10 @@ grapheme_get_haystack_offset(UBreakIterator* bi, UChar *uhaystack, int32_t uhays } if ( offset != 0 ) { - return NULL; + return -1; } - return uhaystack + pos; + return pos; } /* }}} */ @@ -607,8 +374,7 @@ grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned c /* }}} */ /* {{{ grapheme_get_break_iterator: get a clone of the global character break iterator */ -UBreakIterator* -grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ) +UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ) { int32_t buffer_size; diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h index c91aeaff7..14f3f22c4 100644 --- a/ext/intl/grapheme/grapheme_util.h +++ b/ext/intl/grapheme/grapheme_util.h @@ -23,35 +23,25 @@ /* get_break_interator: get a break iterator from the global structure */ UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ); -void -grapheme_substr_ascii(char *str, int32_t str_len, int32_t f, int32_t l, int argc, char **sub_str, int *sub_str_len); +void grapheme_substr_ascii(char *str, int32_t str_len, int32_t f, int32_t l, int argc, char **sub_str, int *sub_str_len); -int -grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case TSRMLS_DC); +int grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case TSRMLS_DC); -int -grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case TSRMLS_DC); +int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case, int last TSRMLS_DC); int grapheme_ascii_check(const unsigned char *day, int32_t len); int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len TSRMLS_DC ); -int32_t -grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len); - -int32_t -grapheme_memnstr_grapheme(UBreakIterator *bi, UChar *haystack, UChar *needle, int32_t needle_len, UChar *end); +int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len); inline void *grapheme_memrchr_grapheme(const void *s, int c, int32_t n); -UChar * -grapheme_get_haystack_offset(UBreakIterator* bi, UChar *uhaystack, int32_t uhaystack_len, int32_t offset); +int grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset); -int32_t -grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned char *needle, int32_t needle_len, int32_t offset); +int32_t grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned char *needle, int32_t needle_len, int32_t offset); -UBreakIterator* -grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ); +UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ); /* OUTSIDE_STRING: check if (possibly negative) long offset is outside the string with int32_t length */ #define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (long) max_len : offset >= (long) max_len) ) diff --git a/ext/intl/resourcebundle/resourcebundle.c b/ext/intl/resourcebundle/resourcebundle.c index 6d39dfb7e..f5475faf1 100644 --- a/ext/intl/resourcebundle/resourcebundle.c +++ b/ext/intl/resourcebundle/resourcebundle.c @@ -41,7 +41,7 @@ void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *so case URES_STRING: ufield = ures_getString( source->child, &ilen, &INTL_DATA_ERROR_CODE(source) ); INTL_METHOD_CHECK_STATUS(source, "Failed to retrieve string value"); - INTL_METHOD_RETVAL_UTF8(source, ufield, ilen, 0); + INTL_METHOD_RETVAL_UTF8(source, (UChar *)ufield, ilen, 0); break; case URES_BINARY: diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index a6a73f5f0..7c1a5c28b 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -162,8 +162,8 @@ PHP_FUNCTION( resourcebundle_create ) /* {{{ resourcebundle_array_fetch */ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback TSRMLS_DC) { - int32_t meindex; - char * mekey; + int32_t meindex = 0; + char * mekey = NULL; long mekeylen; zend_bool is_numeric = 0; char *pbuf; diff --git a/ext/intl/tests/badargs.phpt b/ext/intl/tests/badargs.phpt index 9232bbf0c..264af73ac 100644 --- a/ext/intl/tests/badargs.phpt +++ b/ext/intl/tests/badargs.phpt @@ -1,5 +1,5 @@ --TEST-- -Check that bad argumens return the same +Check that bad arguments return the same --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> --FILE-- diff --git a/ext/intl/tests/bug61860.phpt b/ext/intl/tests/bug61860.phpt new file mode 100644 index 000000000..123d9ff23 --- /dev/null +++ b/ext/intl/tests/bug61860.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #61860: Offsets may be wrong for grapheme_stri* functions +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php +$haystack = 'Auf der Straße nach Paris habe ich mit dem Fahrer gesprochen'; +var_dump( + grapheme_stripos($haystack, 'pariS '), + grapheme_stristr($haystack, 'paRis '), + grapheme_substr($haystack, grapheme_stripos($haystack, 'Paris')) +); + +?> +--EXPECT-- +int(20) +string(40) "Paris habe ich mit dem Fahrer gesprochen" +string(40) "Paris habe ich mit dem Fahrer gesprochen" diff --git a/ext/intl/tests/bug62759.phpt b/ext/intl/tests/bug62759.phpt new file mode 100644 index 000000000..d4126b752 --- /dev/null +++ b/ext/intl/tests/bug62759.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #62759: Buggy grapheme_substr() on edge case +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php +var_dump(substr('deja', 1, -4)); +var_dump(substr('deja', -1, 0)); +var_dump(grapheme_substr('deja', 1, -4)); +var_dump(intl_get_error_message()); +var_dump(grapheme_substr('deja', -1, 0)); +var_dump(grapheme_substr('déjà ', 1, -4)); +var_dump(intl_get_error_message()); +var_dump(grapheme_substr('déjà ', -1, 0)); +?> +--EXPECT-- +bool(false) +string(0) "" +bool(false) +string(61) "grapheme_substr: invalid parameters: U_ILLEGAL_ARGUMENT_ERROR" +string(0) "" +bool(false) +string(65) "grapheme_substr: length is beyond start: U_ILLEGAL_ARGUMENT_ERROR" +string(0) "" diff --git a/ext/intl/tests/transliterator_create_error.phpt b/ext/intl/tests/transliterator_create_error.phpt index 31aef68fe..4f2d04ae7 100644 --- a/ext/intl/tests/transliterator_create_error.phpt +++ b/ext/intl/tests/transliterator_create_error.phpt @@ -6,15 +6,15 @@ Transliterator::create (error) <?php ini_set("intl.error_level", E_WARNING); -Transliterator::create("inexistant id"); +Transliterator::create("inexistent id"); echo intl_get_error_message(), "\n"; Transliterator::create("bad UTF-8 \x8F"); echo intl_get_error_message(), "\n"; echo "Done.\n"; --EXPECTF-- -Warning: Transliterator::create(): transliterator_create: unable to open ICU transliterator with id "inexistant id" in %s on line %d -transliterator_create: unable to open ICU transliterator with id "inexistant id": U_INVALID_ID +Warning: Transliterator::create(): transliterator_create: unable to open ICU transliterator with id "inexistent id" in %s on line %d +transliterator_create: unable to open ICU transliterator with id "inexistent id": U_INVALID_ID Warning: Transliterator::create(): String conversion of id to UTF-16 failed in %s on line %d String conversion of id to UTF-16 failed: U_INVALID_CHAR_FOUND diff --git a/ext/intl/tests/transliterator_transliterate_variant1.phpt b/ext/intl/tests/transliterator_transliterate_variant1.phpt index fc77a4e3a..dcd01efd4 100644 --- a/ext/intl/tests/transliterator_transliterate_variant1.phpt +++ b/ext/intl/tests/transliterator_transliterate_variant1.phpt @@ -13,7 +13,7 @@ echo transliterator_transliterate("\x8F", $str), "\n"; echo intl_get_error_message(), "\n"; class A { -function __toString() { return "inexistant id"; } +function __toString() { return "inexistent id"; } } echo transliterator_transliterate(new A(), $str), "\n"; @@ -29,9 +29,9 @@ Warning: transliterator_transliterate(): Could not create transliterator with ID String conversion of id to UTF-16 failed: U_INVALID_CHAR_FOUND -Warning: transliterator_transliterate(): transliterator_create: unable to open ICU transliterator with id "inexistant id" in %s on line %d +Warning: transliterator_transliterate(): transliterator_create: unable to open ICU transliterator with id "inexistent id" in %s on line %d -Warning: transliterator_transliterate(): Could not create transliterator with ID "inexistant id" (transliterator_create: unable to open ICU transliterator with id "inexistant id": U_INVALID_ID) in %s on line %d +Warning: transliterator_transliterate(): Could not create transliterator with ID "inexistent id" (transliterator_create: unable to open ICU transliterator with id "inexistent id": U_INVALID_ID) in %s on line %d -transliterator_create: unable to open ICU transliterator with id "inexistant id": U_INVALID_ID +transliterator_create: unable to open ICU transliterator with id "inexistent id": U_INVALID_ID Done. diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 3cfa2092e..71d57d6d9 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2107,6 +2107,7 @@ PHP_FUNCTION(ldap_set_rebind_proc) /* unregister rebind procedure */ if (ld->rebindproc != NULL) { zval_dtor(ld->rebindproc); + FREE_ZVAL(ld->rebindproc); ld->rebindproc = NULL; ldap_set_rebind_proc(ld->link, NULL, NULL); } diff --git a/ext/ldap/tests/ldap_get_values_len_error.phpt b/ext/ldap/tests/ldap_get_values_len_error.phpt index 8caea1479..45f9031df 100644 --- a/ext/ldap/tests/ldap_get_values_len_error.phpt +++ b/ext/ldap/tests/ldap_get_values_len_error.phpt @@ -20,7 +20,7 @@ var_dump(ldap_get_values_len($link)); var_dump(ldap_get_values_len($link, $entry)); var_dump(ldap_get_values_len($link, $entry, "weirdAttribute", "Additional data")); -var_dump(ldap_get_values_len($link, $entry, "inexistantAttribute")); +var_dump(ldap_get_values_len($link, $entry, "inexistentAttribute")); ?> ===DONE=== --CLEAN-- diff --git a/ext/ldap/tests/ldap_search_variation6.phpt b/ext/ldap/tests/ldap_search_variation6.phpt index a29e4524d..5139ebb77 100644 --- a/ext/ldap/tests/ldap_search_variation6.phpt +++ b/ext/ldap/tests/ldap_search_variation6.phpt @@ -217,14 +217,26 @@ array(2) { [1]=> resource(%d) of type (ldap result) } -NULL -NULL +array(1) { + ["count"]=> + int(0) +} +array(1) { + ["count"]=> + int(0) +} array(2) { [0]=> resource(%d) of type (ldap result) [1]=> resource(%d) of type (ldap result) } -NULL -NULL +array(1) { + ["count"]=> + int(0) +} +array(1) { + ["count"]=> + int(0) +} ===DONE=== diff --git a/ext/ldap/tests/ldap_set_rebind_proc_error.phpt b/ext/ldap/tests/ldap_set_rebind_proc_error.phpt index 966612f65..c8c798582 100644 --- a/ext/ldap/tests/ldap_set_rebind_proc_error.phpt +++ b/ext/ldap/tests/ldap_set_rebind_proc_error.phpt @@ -35,7 +35,7 @@ function rebind_proc ($ds, $ldap_url) { $link = ldap_connect($host, $port); var_dump(ldap_set_rebind_proc($link)); var_dump(ldap_set_rebind_proc($link, "rebind_proc", "Additional data")); -var_dump(ldap_set_rebind_proc($link, "rebind_proc_inexistant")); +var_dump(ldap_set_rebind_proc($link, "rebind_proc_inexistent")); ?> ===DONE=== --EXPECTF-- @@ -45,6 +45,6 @@ bool(false) Warning: ldap_set_rebind_proc() expects exactly 2 parameters, 3 given in %s on line %d bool(false) -Warning: ldap_set_rebind_proc(): Two arguments expected for 'rebind_proc_inexistant' to be a valid callback in %s on line %d +Warning: ldap_set_rebind_proc(): Two arguments expected for 'rebind_proc_inexistent' to be a valid callback in %s on line %d bool(false) ===DONE=== diff --git a/ext/libxml/tests/bug61367-read.phpt b/ext/libxml/tests/bug61367-read.phpt index 94da3d848..75d0006a3 100644 --- a/ext/libxml/tests/bug61367-read.phpt +++ b/ext/libxml/tests/bug61367-read.phpt @@ -8,7 +8,7 @@ error_reporting=E_ALL & ~E_NOTICE --FILE-- <?php /* - * Note: Using error_reporting=E_ALL & ~E_NOTICE to supress "Trying to get property of non-object" notices. + * Note: Using error_reporting=E_ALL & ~E_NOTICE to suppress "Trying to get property of non-object" notices. */ class StreamExploiter { public function stream_close ( ) { diff --git a/ext/mbstring/README_PHP3-i18n-ja b/ext/mbstring/README_PHP3-i18n-ja index cac00b82a..869fe3e49 100644 --- a/ext/mbstring/README_PHP3-i18n-ja +++ b/ext/mbstring/README_PHP3-i18n-ja @@ -408,7 +408,7 @@ o i18n.script_encoding - script encoding entering the script parser. Be aware that auto detection may fail under some conditions. - For best auto detection, add multibyte charactor at begining of + For best auto detection, add multibyte charactor at beginning of script. diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c index fcee61053..553970034 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c @@ -79,7 +79,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_wchar, - mbfl_filt_conv_common_flush + mbfl_filt_conv_utf8_wchar_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8 = { @@ -93,6 +93,17 @@ const struct mbfl_convert_vtbl vtbl_wchar_utf8 = { #define CK(statement) do { if ((statement) < 0) return (-1); } while (0) +int mbfl_filt_put_invalid_char(int c, mbfl_convert_filter *filter) +{ + int w; + w = c & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + filter->status = 0; + filter->cache = 0; + CK((*filter->output_function)(w, filter->data)); +} + + /* * UTF-8 => wchar */ @@ -100,111 +111,104 @@ int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter) { int s, c1, w = 0, flag = 0; - if (c < 0x80) { - if (filter->status != 0) { - w = (filter->cache & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - filter->status = 0; - filter->cache = 0; - } - if (c >= 0) { +retry: + switch (filter->status & 0xff) { + case 0x00: + if (c < 0x80) { CK((*filter->output_function)(c, filter->data)); + } else if (c >= 0xc2 && c <= 0xdf) { /* 2byte code first char: 0xc2-0xdf */ + filter->status = 0x10; + filter->cache = c & 0x1f; + } else if (c >= 0xe0 && c <= 0xef) { /* 3byte code first char: 0xe0-0xef */ + filter->status = 0x20; + filter->cache = c & 0xf; + } else if (c >= 0xf0 && c <= 0xf4) { /* 3byte code first char: 0xf0-0xf4 */ + filter->status = 0x30; + filter->cache = c & 0x7; + } else { + mbfl_filt_put_invalid_char(c, filter); } - } else if (c < 0xc0) { - int status = filter->status & 0xff; - switch (status) { - case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ - case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ - case 0x32: /* 4byte code 4th char: 0x80-0xbf */ - filter->status = 0; - s = filter->cache | (c & 0x3f); + break; + case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ + case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ + case 0x32: /* 4byte code 4th char: 0x80-0xbf */ + filter->status = 0; + if (c >= 0x80 && c <= 0xbf) { + s = (filter->cache<<6) | (c & 0x3f); filter->cache = 0; - if ((status == 0x10 && s >= 0x80) || - (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x10000 && s < 0x110000)) { - CK((*filter->output_function)(s, filter->data)); - } else { - w = s & MBFL_WCSGROUP_MASK; - flag = 1; - } - break; - case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ - s = filter->cache | ((c & 0x3f) << 6); - c1 = (s >> 12) & 0xf; - if ((c1 == 0x0 && c >= 0xa0) || - (c1 == 0xd && c < 0xa0) || - (c1 > 0x0 && c1 != 0xd)) { - filter->cache = s; - filter->status++; - } else { - w = s & MBFL_WCSGROUP_MASK; - flag = 1; - } - break; - case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ - filter->cache |= ((c & 0x3f) << 6); - filter->status++; - break; - case 0x30: /* 4byte code 2nd char: 0:0x90-0xbf,1-3:0x80-0xbf,4:0x80-0x8f */ - s = filter->cache | ((c & 0x3f) << 12); - c1 = (s >> 18) & 0x7; - if ((c1 == 0x0 && c >= 0x90) || - (c1 > 0x0 && c1 < 0x4) || - (c1 == 0x4 && c < 0x90)) { - filter->cache = s; - filter->status++; - } else { - w = s & MBFL_WCSGROUP_MASK; - flag = 1; - } - break; - default: - w = c & MBFL_WCSGROUP_MASK; - flag = 1; - break; + CK((*filter->output_function)(s, filter->data)); + } else { + mbfl_filt_put_invalid_char(filter->cache, filter); + goto retry; } - } else if (c < 0xc2) { /* invalid: 0xc0,0xc1 */ - w = c & MBFL_WCSGROUP_MASK; - flag = 1; - } else if (c < 0xe0) { /* 2byte code first char: 0xc2-0xdf */ - if (filter->status == 0x0) { - filter->status = 0x10; - filter->cache = (c & 0x1f) << 6; + break; + case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ + s = (filter->cache<<6) | (c & 0x3f); + c1 = filter->cache & 0xf; + + if ((c >= 0x80 && c <= 0xbf) && + ((c1 == 0x0 && c >= 0xa0) || + (c1 == 0xd && c < 0xa0) || + (c1 > 0x0 && c1 != 0xd))) { + filter->cache = s; + filter->status++; } else { - w = c & MBFL_WCSGROUP_MASK; - flag = 1; + mbfl_filt_put_invalid_char(filter->cache, filter); + goto retry; } - } else if (c < 0xf0) { /* 3byte code first char: 0xe0-0xef */ - if (filter->status == 0x0) { - filter->status = 0x20; - filter->cache = (c & 0xf) << 12; + break; + case 0x30: /* 4byte code 2nd char: 0:0x90-0xbf,1-3:0x80-0xbf,4:0x80-0x8f */ + s = (filter->cache<<6) | (c & 0x3f); + c1 = filter->cache & 0x7; + + if ((c >= 0x80 && c <= 0xbf) && + ((c1 == 0x0 && c >= 0x90) || + (c1 == 0x4 && c < 0x90) || + (c1 > 0x0 && c1 != 0x4))) { + filter->cache = s; + filter->status++; } else { - w = c & MBFL_WCSGROUP_MASK; - flag = 1; + mbfl_filt_put_invalid_char(filter->cache, filter); + goto retry; } - } else if (c < 0xf5) { /* 4byte code first char: 0xf0-0xf4 */ - if (filter->status == 0x0) { - filter->status = 0x30; - filter->cache = (c & 0x7) << 18; + break; + case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ + if (c >= 0x80 && c <= 0xbf) { + filter->cache = (filter->cache<<6) | (c & 0x3f); + filter->status++; } else { - w = c & MBFL_WCSGROUP_MASK; - flag = 1; + mbfl_filt_put_invalid_char(filter->cache, filter); + goto retry; } - } else { - w = c & MBFL_WCSGROUP_MASK; - flag = 1; - } - - if (flag) { - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); + break; + default: filter->status = 0; - filter->cache = 0; + break; } return c; } +int mbfl_filt_conv_utf8_wchar_flush(mbfl_convert_filter *filter) +{ + int status, cache; + + status = filter->status; + cache = filter->cache; + + filter->status = 0; + filter->cache = 0; + + if (status != 0) { + mbfl_filt_put_invalid_char(cache, filter); + } + + if (filter->flush_function != NULL) { + (*filter->flush_function)(filter->data); + } + return 0; +} + /* * wchar => UTF-8 */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8.h b/ext/mbstring/libmbfl/filters/mbfilter_utf8.h index 07bf65502..970ace646 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8.h +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8.h @@ -37,5 +37,6 @@ extern const struct mbfl_convert_vtbl vtbl_wchar_utf8; int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter); int mbfl_filt_conv_wchar_utf8(int c, mbfl_convert_filter *filter); +int mbfl_filt_conv_utf8_wchar_flush(mbfl_convert_filter *filter); #endif /* MBFL_MBFILTER_UTF8_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c index 62feca40b..f9b643c17 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c @@ -37,6 +37,7 @@ #include "mbfilter_sjis_mobile.h" extern int mbfl_filt_ident_utf8(int c, mbfl_identify_filter *filter); +extern int mbfl_filt_conv_utf8_wchar_flush(mbfl_convert_filter *filter); extern const unsigned char mblen_table_utf8[]; @@ -115,7 +116,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_docomo_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_mobile_wchar, - mbfl_filt_conv_common_flush + mbfl_filt_conv_utf8_wchar_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8_docomo = { @@ -133,7 +134,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_kddi_a_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_mobile_wchar, - mbfl_filt_conv_common_flush + mbfl_filt_conv_utf8_wchar_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8_kddi_a = { @@ -151,7 +152,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_kddi_b_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_mobile_wchar, - mbfl_filt_conv_common_flush + mbfl_filt_conv_utf8_wchar_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8_kddi_b = { @@ -169,7 +170,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_sb_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_mobile_wchar, - mbfl_filt_conv_common_flush + mbfl_filt_conv_utf8_wchar_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8_sb = { @@ -191,119 +192,97 @@ int mbfl_filt_conv_utf8_mobile_wchar(int c, mbfl_convert_filter *filter) int s, w = 0, flag = 0; int s1 = 0, c1 = 0, snd = 0; - if (c < 0x80) { - if (c >= 0) { +retry: + switch (filter->status & 0xff) { + case 0x00: + if (c < 0x80) { CK((*filter->output_function)(c, filter->data)); + } else if (c >= 0xc2 && c <= 0xdf) { /* 2byte code first char: 0xc2-0xdf */ + filter->status = 0x10; + filter->cache = c & 0x1f; + } else if (c >= 0xe0 && c <= 0xef) { /* 3byte code first char: 0xe0-0xef */ + filter->status = 0x20; + filter->cache = c & 0xf; + } else if (c >= 0xf0 && c <= 0xf4) { /* 3byte code first char: 0xf0-0xf4 */ + filter->status = 0x30; + filter->cache = c & 0x7; + } else { + mbfl_filt_put_invalid_char(c, filter); } + break; + case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ + case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ + case 0x32: /* 4byte code 4th char: 0x80-0xbf */ filter->status = 0; - } else if (c < 0xc0) { - int status = filter->status & 0xff; - switch (status) { - case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ - case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ - case 0x32: /* 4byte code 4th char: 0x80-0xbf */ - filter->status = 0; - s = filter->cache | (c & 0x3f); + if (c >= 0x80 && c <= 0xbf) { + s = (filter->cache<<6) | (c & 0x3f); filter->cache = 0; - if ((status == 0x10 && s >= 0x80) || - (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x10000 && s < 0x110000)) { - - if (filter->from->no_encoding == mbfl_no_encoding_utf8_docomo && - mbfilter_conv_r_map_tbl(s, &s1, mbfl_docomo2uni_pua, 4) > 0) { - s = mbfilter_sjis_emoji_docomo2unicode(s1, &snd); - } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_kddi_a && - mbfilter_conv_r_map_tbl(s, &s1, mbfl_kddi2uni_pua, 7) > 0) { - s = mbfilter_sjis_emoji_kddi2unicode(s1, &snd); - } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_kddi_b && - mbfilter_conv_r_map_tbl(s, &s1, mbfl_kddi2uni_pua_b, 8) > 0) { - s = mbfilter_sjis_emoji_kddi2unicode(s1, &snd); - } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_sb && - mbfilter_conv_r_map_tbl(s, &s1, mbfl_sb2uni_pua, 6) > 0) { - s = mbfilter_sjis_emoji_sb2unicode(s1, &snd); - } - - if (snd > 0) { - CK((*filter->output_function)(snd, filter->data)); - } - CK((*filter->output_function)(s, filter->data)); - } else { - w = s & MBFL_WCSGROUP_MASK; - flag = 1; - } - break; - case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ - s = filter->cache | ((c & 0x3f) << 6); - c1 = (s >> 12) & 0xf; - if ((c1 == 0x0 && c >= 0xa0) || - (c1 == 0xd && c < 0xa0) || - (c1 > 0x0 && c1 != 0xd)) { - filter->cache = s; - filter->status++; - } else { - w = s & MBFL_WCSGROUP_MASK; - flag = 1; + + if (filter->from->no_encoding == mbfl_no_encoding_utf8_docomo && + mbfilter_conv_r_map_tbl(s, &s1, mbfl_docomo2uni_pua, 4) > 0) { + s = mbfilter_sjis_emoji_docomo2unicode(s1, &snd); + } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_kddi_a && + mbfilter_conv_r_map_tbl(s, &s1, mbfl_kddi2uni_pua, 7) > 0) { + s = mbfilter_sjis_emoji_kddi2unicode(s1, &snd); + } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_kddi_b && + mbfilter_conv_r_map_tbl(s, &s1, mbfl_kddi2uni_pua_b, 8) > 0) { + s = mbfilter_sjis_emoji_kddi2unicode(s1, &snd); + } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_sb && + mbfilter_conv_r_map_tbl(s, &s1, mbfl_sb2uni_pua, 6) > 0) { + s = mbfilter_sjis_emoji_sb2unicode(s1, &snd); } - break; - case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ - filter->cache |= ((c & 0x3f) << 6); - filter->status++; - break; - case 0x30: /* 4byte code 2nd char: 0:0x90-0xbf,1-3:0x80-0xbf,4:0x80-0x8f */ - s = filter->cache | ((c & 0x3f) << 12); - c1 = (s >> 18) & 0x7; - if ((c1 == 0x0 && c >= 0x90) || - (c1 > 0x0 && c1 < 0x4) || - (c1 == 0x4 && c < 0x90)) { - filter->cache = s; - filter->status++; - } else { - w = s & MBFL_WCSGROUP_MASK; - flag = 1; + + if (snd > 0) { + CK((*filter->output_function)(snd, filter->data)); } - break; - default: - w = c & MBFL_WCSGROUP_MASK; - flag = 1; - break; + CK((*filter->output_function)(s, filter->data)); + } else { + mbfl_filt_put_invalid_char(filter->cache, filter); + goto retry; } - } else if (c < 0xc2) { /* invalid: 0xc0,0xc1 */ - w = c & MBFL_WCSGROUP_MASK; - flag = 1; - } else if (c < 0xe0) { /* 2byte code first char: 0xc2-0xdf */ - if (filter->status == 0x0) { - filter->status = 0x10; - filter->cache = (c & 0x1f) << 6; + break; + case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ + s = (filter->cache<<6) | (c & 0x3f); + c1 = filter->cache & 0xf; + + if ((c >= 0x80 && c <= 0xbf) && + ((c1 == 0x0 && c >= 0xa0) || + (c1 == 0xd && c < 0xa0) || + (c1 > 0x0 && c1 != 0xd))) { + filter->cache = s; + filter->status++; } else { - w = c & MBFL_WCSGROUP_MASK; - flag = 1; + mbfl_filt_put_invalid_char(filter->cache, filter); + goto retry; } - } else if (c < 0xf0) { /* 3byte code first char: 0xe0-0xef */ - if (filter->status == 0x0) { - filter->status = 0x20; - filter->cache = (c & 0xf) << 12; + break; + case 0x30: /* 4byte code 2nd char: 0:0x90-0xbf,1-3:0x80-0xbf,4:0x80-0x8f */ + s = (filter->cache<<6) | (c & 0x3f); + c1 = filter->cache & 0x7; + + if ((c >= 0x80 && c <= 0xbf) && + ((c1 == 0x0 && c >= 0x90) || + (c1 == 0x4 && c < 0x90) || + (c1 > 0x0 && c1 != 0x4))) { + filter->cache = s; + filter->status++; } else { - w = c & MBFL_WCSGROUP_MASK; - flag = 1; + mbfl_filt_put_invalid_char(filter->cache, filter); + goto retry; } - } else if (c < 0xf5) { /* 4byte code first char: 0xf0-0xf4 */ - if (filter->status == 0x0) { - filter->status = 0x30; - filter->cache = (c & 0x7) << 18; + break; + case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ + if (c >= 0x80 && c <= 0xbf) { + filter->cache = (filter->cache<<6) | (c & 0x3f); + filter->status++; } else { - w = c & MBFL_WCSGROUP_MASK; - flag = 1; + mbfl_filt_put_invalid_char(filter->cache, filter); + goto retry; } - } else { - w = c & MBFL_WCSGROUP_MASK; - flag = 1; - } - - if (flag) { - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); + break; + default: filter->status = 0; - filter->cache = 0; + break; } return c; diff --git a/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h b/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h index 5ae282e91..cb6c445e7 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h @@ -4643,7 +4643,7 @@ static const int ucs_r2_jisx0213_min = 0xFA0F; static const int ucs_r2_jisx0213_max = 0xFA6A; /* - CJK Compatibility Ideographs: U+F900 - U+FAFF (seperate mapping for U+F9XX) + CJK Compatibility Ideographs: U+F900 - U+FAFF (separate mapping for U+F9XX) */ static const unsigned short ucs_r2b_jisx0213_cmap_key[] = { 0xf91d,0xf928,0xf929,0xf936,0xf970,0xf9d0,0xf9dc}; diff --git a/ext/mbstring/oniguruma/HISTORY b/ext/mbstring/oniguruma/HISTORY index a1debefa4..647a46090 100644 --- a/ext/mbstring/oniguruma/HISTORY +++ b/ext/mbstring/oniguruma/HISTORY @@ -673,7 +673,7 @@ History 2004/10/18: [impl] (thanks Imai Yasumasa) enclose #include <sys/types.h> by #ifndef __BORLANDC__. 2004/10/18: [bug] (thanks Imai Yasumasa) - memory acess violation in select_opt_exact_info(). + memory access violation in select_opt_exact_info(). 2004/09/25: [dist] fix doc/API and doc/API.ja. 2004/09/25: [bug] fix OP_SEMI_END_BUF process in match_at() for the case USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE @@ -1607,7 +1607,7 @@ History 2003/01/31: [impl] rename TTRANS() to TOLOWER(). 2003/01/30: [bug] .c.o --> .c.obj in win32\Makefile. 2003/01/30: [impl] add -DNOT_RUBY to Makefile.in. - NOT_RUBY is refered in regint.h for escape double + NOT_RUBY is referred in regint.h for escape double including config.h. 2003/01/30: [impl] when string hasn't case ambiguity, don't compile to ignore case opcode. diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 145ee0c13..607921ebb 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -648,7 +648,7 @@ _php_mb_regex_init_options(const char *parg, int narg, OnigOptionType *option, O /* }}} */ /* - * php funcions + * php functions */ /* {{{ proto string mb_regex_encoding([string encoding]) diff --git a/ext/mbstring/tests/bug65045.phpt b/ext/mbstring/tests/bug65045.phpt new file mode 100644 index 000000000..03a090ded --- /dev/null +++ b/ext/mbstring/tests/bug65045.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #65045: mb_convert_encoding breaks well-formed character +--SKIPIF-- +<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?> +--FILE-- +<?php + +//declare(encoding = 'UTF-8'); +mb_internal_encoding('UTF-8'); + +$str = "\xF0\xA4\xAD". "\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2"; +$expected = "\xEF\xBF\xBD"."\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2"; + +$str2 = "\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD"; +$expected2 = "\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2"."\xEF\xBF\xBD"; + +mb_substitute_character(0xFFFD); +var_dump( + $expected === htmlspecialchars_decode(htmlspecialchars($str, ENT_SUBSTITUTE, 'UTF-8')), + $expected2 === htmlspecialchars_decode(htmlspecialchars($str2, ENT_SUBSTITUTE, 'UTF-8')), + $expected === mb_convert_encoding($str, 'UTF-8', 'UTF-8'), + $expected2 === mb_convert_encoding($str2, 'UTF-8', 'UTF-8') +); + +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true)
\ No newline at end of file diff --git a/ext/mbstring/tests/illformed_utf_sequences.phpt b/ext/mbstring/tests/illformed_utf_sequences.phpt index b5b9d94db..378b956d6 100644 --- a/ext/mbstring/tests/illformed_utf_sequences.phpt +++ b/ext/mbstring/tests/illformed_utf_sequences.phpt @@ -25,28 +25,28 @@ var_dump(chk_enc("\x31\x32\x33", 0)); var_dump(chk_enc("\x41\x42\x43", 0)); var_dump(chk_enc("\xc0\xb1\xc0\xb2\xc0\xb3", 6)); var_dump(chk_enc("\xc1\x81\xc1\x82\xc1\x83", 6)); -var_dump(chk_enc("\xe0\x80\xb1\xe0\x80\xb2\xe0\x80\xb3", 6)); -var_dump(chk_enc("\xe0\x81\x81\xe0\x81\x82\xe0\x81\x83", 6)); -var_dump(chk_enc("\xf0\x80\x80\xb1\xf0\x80\x80\xb2\xf0\x80\x80\xb3", 9)); -var_dump(chk_enc("\xf0\x80\x81\x81\xf0\x80\x81\x82\xf0\x81\x83", 8)); +var_dump(chk_enc("\xe0\x80\xb1\xe0\x80\xb2\xe0\x80\xb3", 9)); +var_dump(chk_enc("\xe0\x81\x81\xe0\x81\x82\xe0\x81\x83", 9)); +var_dump(chk_enc("\xf0\x80\x80\xb1\xf0\x80\x80\xb2\xf0\x80\x80\xb3", 12)); +var_dump(chk_enc("\xf0\x80\x81\x81\xf0\x80\x81\x82\xf0\x81\x83", 11)); var_dump(chk_enc("\xf8\x80\x80\x80\xb1\xf8\x80\x80\x80\xb2\xf8\x80\x80\x80\xb3", 15)); var_dump(chk_enc("\xf8\x80\x80\x81\x81\xf8\x80\x80\x81\x82\xf8\x80\x80\x81\x83", 15)); var_dump(chk_enc("\xfc\x80\x80\x80\x80\xb1\xfc\x80\x80\x80\x80\xb2\xfc\x80\x80\x80\x80\xb3", 18)); var_dump(chk_enc("\xfc\x80\x80\x80\x81\x81\xfc\x80\x80\x80\x81\x82\xfc\x80\x80\x80\x81\x83", 18)); var_dump(chk_enc("\xc2\xa2\xc2\xa3\xc2\xa5", 0)); -var_dump(chk_enc("\xe0\x82\xa2\xe0\x82\xa3\xe0\x82\xa5", 6)); -var_dump(chk_enc("\xf0\x80\x82\xa2\xf0\x80\x82\xa3\xf0\x80\x82\xa5", 9)); +var_dump(chk_enc("\xe0\x82\xa2\xe0\x82\xa3\xe0\x82\xa5", 9)); +var_dump(chk_enc("\xf0\x80\x82\xa2\xf0\x80\x82\xa3\xf0\x80\x82\xa5", 12)); var_dump(chk_enc("\xf8\x80\x80\x82\xa2\xf8\x80\x80\x82\xa3\xf8\x80\x80\x82\xa5", 15)); var_dump(chk_enc("\xfc\x80\x80\x80\x82\xa2\xfc\x80\x80\x80\x82\xa3\xfc\x80\x80\x80\x82\xa5", 18)); var_dump(chk_enc("\xc1\xbf", 2)); var_dump(chk_enc("\xc2\x80", 0)); var_dump(chk_enc("\xdf\xbf", 0)); -var_dump(chk_enc("\xe0\x9f\xff", 2)); +var_dump(chk_enc("\xe0\x9f\xff", 3)); var_dump(chk_enc("\xe0\xa0\x80", 2)); var_dump(chk_enc("\xef\xbf\xbf", 0)); -var_dump(chk_enc("\xf0\x8f\xbf\xbf", 3)); +var_dump(chk_enc("\xf0\x8f\xbf\xbf", 4)); var_dump(chk_enc("\xf0\x90\x80\x80", 0)); var_dump(chk_enc("\xf7\xbf\xbf\xbf", 4)); var_dump(chk_enc("\xf8\x87\xbf\xbf\xbf", 5)); @@ -61,7 +61,7 @@ echo "UTF-8 and surrogates area\n"; $out = ''; $cnt = 0; for ($i = 0xd7ff; $i <= 0xe000; ++$i) { - $s = chk_enc(pack('C3', 0xe0 | ($i >> 12), 0x80 | ($i >> 6) & 0x3f, 0x80 | $i & 0x3f), 2); + $s = chk_enc(pack('C3', 0xe0 | ($i >> 12), 0x80 | ($i >> 6) & 0x3f, 0x80 | $i & 0x3f), 3); if ($s === false) { $cnt++; } else { diff --git a/ext/mbstring/tests/mb_http_output.phpt b/ext/mbstring/tests/mb_http_output.phpt index 7fb3335fe..6f149bfc9 100644 --- a/ext/mbstring/tests/mb_http_output.phpt +++ b/ext/mbstring/tests/mb_http_output.phpt @@ -4,7 +4,7 @@ mb_http_output() <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?> --FILE-- <?php -//TODO: Add more encoding. Wrong paramter type test. +//TODO: Add more encoding. Wrong parameter type test. //$debug = true; ini_set('include_path', dirname(__FILE__)); include_once('common.inc'); diff --git a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt index 5fb642f9b..6219e585e 100644 --- a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt +++ b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt @@ -1,5 +1,7 @@ --TEST-- Optional long parameter might be null +--SKIPIF-- +<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?> --FILE-- <?php echo mb_strpos('abb', 'b', null, 'UTF-8') . "\n"; diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4 index 5968c4334..998323d7c 100644 --- a/ext/mysql/config.m4 +++ b/ext/mysql/config.m4 @@ -45,7 +45,7 @@ PHP_ARG_WITH(mysql, for MySQL support, mysqlnd the MySQL native driver will be used]) PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket, -[ --with-mysql-sock[=DIR] MySQL/MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer. +[ --with-mysql-sock[=SOCKPATH] MySQL/MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer. If unspecified, the default locations are searched], no, no) if test -z "$PHP_ZLIB_DIR"; then diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 5ad7bc903..078b402ff 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -296,7 +296,7 @@ static const zend_function_entry mysql_functions[] = { #ifdef MYSQL_HAS_SET_CHARSET PHP_FE(mysql_set_charset, arginfo_mysql_set_charset) #endif - /* for downwards compatability */ + /* for downwards compatibility */ PHP_FALIAS(mysql, mysql_db_query, arginfo_mysql_db_query) PHP_FALIAS(mysql_fieldname, mysql_field_name, arginfo_mysql_field_name) PHP_FALIAS(mysql_fieldtable, mysql_field_table, arginfo_mysql_field_seek) @@ -720,7 +720,7 @@ PHP_MINFO_FUNCTION(mysql) static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) { char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, *tmp=NULL, *host=NULL; - int user_len, passwd_len, host_len; + int user_len = 0, passwd_len = 0, host_len = 0; char *hashed_details=NULL; int hashed_details_length, port = MYSQL_PORT; long client_flags = 0; @@ -1918,7 +1918,7 @@ PHP_FUNCTION(mysql_result) /* johannes TODO: -Do 2 zend_parse_paramters calls instead of type "z" and switch below +Do 2 zend_parse_parameters calls instead of type "z" and switch below Q: String or long first? */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &result, &row, &field) == FAILURE) { diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index a4c1b874f..2710b9de2 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -531,7 +531,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_ #include "ext/mysqlnd/mysqlnd_reverse_api.h" static MYSQLND *mysqli_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC) { - if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJCE_P(zv) == mysqli_link_class_entry) { + if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), mysqli_link_class_entry TSRMLS_CC)) { MY_MYSQL * mysql; MYSQLI_RESOURCE * my_res; mysqli_object * intern = (mysqli_object *)zend_object_store_get_object(zv TSRMLS_CC); @@ -1257,7 +1257,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags php_mysqli_fetch_into_hash_aux(return_value, result, fetchtype TSRMLS_CC); - if (into_object && Z_TYPE_P(return_value) != IS_NULL) { + if (into_object && Z_TYPE_P(return_value) == IS_ARRAY) { zval dataset = *return_value; zend_fcall_info fci; zend_fcall_info_cache fcc; diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 2ad1a2040..e1557efce 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -564,7 +564,7 @@ PHP_FUNCTION(mysqli_query) MY_MYSQL *mysql; zval *mysql_link; MYSQLI_RESOURCE *mysqli_resource; - MYSQL_RES *result; + MYSQL_RES *result = NULL; char *query = NULL; int query_len; long resultmode = MYSQLI_STORE_RESULT; @@ -835,7 +835,7 @@ PHP_FUNCTION(mysqli_reap_async_query) MY_MYSQL *mysql; zval *mysql_link; MYSQLI_RESOURCE *mysqli_resource; - MYSQL_RES *result; + MYSQL_RES *result = NULL; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { return; diff --git a/ext/mysqli/tests/bug34810.phpt b/ext/mysqli/tests/bug34810.phpt index 1ea89d9be..4fe87f4c0 100644 --- a/ext/mysqli/tests/bug34810.phpt +++ b/ext/mysqli/tests/bug34810.phpt @@ -16,7 +16,7 @@ class DbConnection { var_dump($link); $link = mysqli_init(); - /* @ is to supress 'Property access is not allowed yet' */ + /* @ is to suppress 'Property access is not allowed yet' */ @var_dump($link); $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket); diff --git a/ext/mysqli/tests/bug64726.phpt b/ext/mysqli/tests/bug64726.phpt new file mode 100644 index 000000000..8f24ad09b --- /dev/null +++ b/ext/mysqli/tests/bug64726.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #63398 (Segfault when calling fetch_object on a use_result and DB pointer has closed) +--SKIPIF-- +<?php +require_once('skipif.inc'); +require_once("connect.inc"); +if (!$IS_MYSQLND) { + die("skip mysqlnd only test"); +} +require_once('skipifconnectfailure.inc'); +?> +--FILE-- +<?php +require 'connect.inc'; +$db = new my_mysqli($host, $user, $passwd, $db, $port, $socket); + +$result = $db->query('SELECT 1', MYSQLI_USE_RESULT); +$db->close(); +var_dump($result->fetch_object()); +?> +--EXPECTF-- +Warning: mysqli_result::fetch_object(): Error while reading a row in %sbug64726.php on line %d +bool(false) diff --git a/ext/mysqli/tests/mysqli_driver.phpt b/ext/mysqli/tests/mysqli_driver.phpt index 4e266a053..023e4d229 100644 --- a/ext/mysqli/tests/mysqli_driver.phpt +++ b/ext/mysqli/tests/mysqli_driver.phpt @@ -53,7 +53,7 @@ require_once('skipifconnectfailure.inc'); } catch (mysqli_sql_exception $e) { $ok = true; if ('' == $e->getMessage()) - printf("[008] getMessage() has returned an emptry string.\n"); + printf("[008] getMessage() has returned an empty string.\n"); if ('' == $e->getCode()) printf("[009] getCode() has returned an empty string.\n"); if ('' == $e->getFile()) diff --git a/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt b/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt index fa00ecda1..ac2e7c000 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt @@ -17,7 +17,7 @@ mysqli_fetch_assoc() - utf8 die("skip Looks like UTF8 is not available on the server"); if (strtolower($tmp['Charset']) !== 'utf8') - die("skip Not sure if UTF8 is available, cancelling the test"); + die("skip Not sure if UTF8 is available, canceling the test"); mysqli_free_result($res); @@ -28,7 +28,7 @@ mysqli_fetch_assoc() - utf8 die("skip Looks like UCS2 is not available on the server"); if (strtolower($tmp['Charset']) !== 'ucs2') - die("skip Not sure if UCS2 is available, cancelling the test"); + die("skip Not sure if UCS2 is available, canceling the test"); mysqli_free_result($res); mysqli_close($link); diff --git a/ext/mysqli/tests/mysqli_get_client_stats.phpt b/ext/mysqli/tests/mysqli_get_client_stats.phpt index ef5ef6ee6..a22fc58f5 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats.phpt @@ -166,7 +166,7 @@ mysqlnd.collect_memory_statistics=1 mysqli_get_client_stats_assert_gt('bytes_sent', $info, $expected, $test_counter); mysqli_get_client_stats_assert_gt('bytes_received', $info, $expected, $test_counter); - // real_data_* get incremeneted after mysqli_*fetch*() + // real_data_* get incremented after mysqli_*fetch*() mysqli_get_client_stats_assert_eq('bytes_received_real_data_normal', $info, "0", $test_counter); mysqli_get_client_stats_assert_eq('bytes_received_real_data_ps', $info, "0", $test_counter); diff --git a/ext/mysqli/tests/mysqli_options.phpt b/ext/mysqli/tests/mysqli_options.phpt index 2f7986d3f..5daaa597f 100644 --- a/ext/mysqli/tests/mysqli_options.phpt +++ b/ext/mysqli/tests/mysqli_options.phpt @@ -12,7 +12,7 @@ require_once('skipifconnectfailure.inc'); $valid_options = array( MYSQLI_READ_DEFAULT_GROUP => "MYSQLI_READ_DEFAULT_GROUP", - MYSQLI_READ_DEFAULT_FILE => "MYSQLI_READ_DEFAUTL_FILE", + MYSQLI_READ_DEFAULT_FILE => "MYSQLI_READ_DEFAULT_FILE", MYSQLI_OPT_CONNECT_TIMEOUT => "MYSQLI_OPT_CONNECT_TIMEOUT", MYSQLI_OPT_LOCAL_INFILE => "MYSQLI_OPT_LOCAL_INFILE", MYSQLI_INIT_COMMAND => "MYSQLI_INIT_COMMAND", diff --git a/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt b/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt new file mode 100644 index 000000000..d7a78f1cf --- /dev/null +++ b/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt @@ -0,0 +1,50 @@ +--TEST-- +mysqli_stmt_prepare() +--SKIPIF-- +<?php +require_once('skipif.inc'); +require_once('skipifemb.inc'); +require_once('skipifconnectfailure.inc'); +?> +--FILE-- +<?php + require_once("connect.inc"); + + // Note: No SQL tests here! We can expand one of the *fetch() + // tests to a generic SQL test, if we ever need that. + // We would duplicate the SQL test cases if we have it here and in one of the + // fetch tests, because the fetch tests would have to call prepare/execute etc. + // anyway. + + $tmp = NULL; + $link = NULL; + + require('table.inc'); + + $cleanupIds = range(1000, 3007); + $model = 50; + + $params = '(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'; + + + /* create a prepared statement */ + if ($stmt = $link->prepare("SHOW STATUS WHERE 1 = ? AND 1 IN {$params}")) { + + $stmt->bind_param('iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii', $model, $cleanupIds[0], $cleanupIds[1], $cleanupIds[2], $cleanupIds[3], $cleanupIds[4], $cleanupIds[5], $cleanupIds[6], $cleanupIds[7], $cleanupIds[8], $cleanupIds[9], $cleanupIds[10], $cleanupIds[11], $cleanupIds[12], $cleanupIds[13], $cleanupIds[14], $cleanupIds[15], $cleanupIds[16], $cleanupIds[17], $cleanupIds[18], $cleanupIds[19], $cleanupIds[20], $cleanupIds[21], $cleanupIds[22], $cleanupIds[23], $cleanupIds[24], $cleanupIds[25], $cleanupIds[26], $cleanupIds[27], $cleanupIds[28], $cleanupIds[29], $cleanupIds[30], $cleanupIds[31], $cleanupIds[32], $cleanupIds[33], $cleanupIds[34], $cleanupIds[35], $cleanupIds[36], $cleanupIds[37], $cleanupIds[38], $cleanupIds[39], $cleanupIds[40], $cleanupIds[41], $cleanupIds[42], $cleanupIds[43], $cleanupIds[44], $cleanupIds[45], $cleanupIds[46], $cleanupIds[47], $cleanupIds[48], $cleanupIds[49], $cleanupIds[50], $cleanupIds[51], $cleanupIds[52], $cleanupIds[53], $cleanupIds[54], $cleanupIds[55], $cleanupIds[56], $cleanupIds[57], $cleanupIds[58], $cleanupIds[59], $cleanupIds[60], $cleanupIds[61], $cleanupIds[62], $cleanupIds[63], $cleanupIds[64], $cleanupIds[65], $cleanupIds[66], $cleanupIds[67], $cleanupIds[68], $cleanupIds[69], $cleanupIds[70], $cleanupIds[71], $cleanupIds[72], $cleanupIds[73], $cleanupIds[74], $cleanupIds[75], $cleanupIds[76], $cleanupIds[77], $cleanupIds[78], $cleanupIds[79], $cleanupIds[80], $cleanupIds[81], $cleanupIds[82], $cleanupIds[83], $cleanupIds[84], $cleanupIds[85], $cleanupIds[86], $cleanupIds[87], $cleanupIds[88], $cleanupIds[89], $cleanupIds[90], $cleanupIds[91], $cleanupIds[92], $cleanupIds[93], $cleanupIds[94], $cleanupIds[95], $cleanupIds[96], $cleanupIds[97], $cleanupIds[98], $cleanupIds[99], $cleanupIds[100], $cleanupIds[101], $cleanupIds[102], $cleanupIds[103], $cleanupIds[104], $cleanupIds[105], $cleanupIds[106], $cleanupIds[107], $cleanupIds[108], $cleanupIds[109], $cleanupIds[110], $cleanupIds[111], $cleanupIds[112], $cleanupIds[113], $cleanupIds[114], $cleanupIds[115], $cleanupIds[116], $cleanupIds[117], $cleanupIds[118], $cleanupIds[119], $cleanupIds[120], $cleanupIds[121], $cleanupIds[122], $cleanupIds[123], $cleanupIds[124], $cleanupIds[125], $cleanupIds[126], $cleanupIds[127], $cleanupIds[128], $cleanupIds[129], $cleanupIds[130], $cleanupIds[131], $cleanupIds[132], $cleanupIds[133], $cleanupIds[134], $cleanupIds[135], $cleanupIds[136], $cleanupIds[137], $cleanupIds[138], $cleanupIds[139], $cleanupIds[140], $cleanupIds[141], $cleanupIds[142], $cleanupIds[143], $cleanupIds[144], $cleanupIds[145], $cleanupIds[146], $cleanupIds[147], $cleanupIds[148], $cleanupIds[149], $cleanupIds[150], $cleanupIds[151], $cleanupIds[152], $cleanupIds[153], $cleanupIds[154], $cleanupIds[155], $cleanupIds[156], $cleanupIds[157], $cleanupIds[158], $cleanupIds[159], $cleanupIds[160], $cleanupIds[161], $cleanupIds[162], $cleanupIds[163], $cleanupIds[164], $cleanupIds[165], $cleanupIds[166], $cleanupIds[167], $cleanupIds[168], $cleanupIds[169], $cleanupIds[170], $cleanupIds[171], $cleanupIds[172], $cleanupIds[173], $cleanupIds[174], $cleanupIds[175], $cleanupIds[176], $cleanupIds[177], $cleanupIds[178], $cleanupIds[179], $cleanupIds[180], $cleanupIds[181], $cleanupIds[182], $cleanupIds[183], $cleanupIds[184], $cleanupIds[185], $cleanupIds[186], $cleanupIds[187], $cleanupIds[188], $cleanupIds[189], $cleanupIds[190], $cleanupIds[191], $cleanupIds[192], $cleanupIds[193], $cleanupIds[194], $cleanupIds[195], $cleanupIds[196], $cleanupIds[197], $cleanupIds[198], $cleanupIds[199], $cleanupIds[200], $cleanupIds[201], $cleanupIds[202], $cleanupIds[203], $cleanupIds[204], $cleanupIds[205], $cleanupIds[206], $cleanupIds[207], $cleanupIds[208], $cleanupIds[209], $cleanupIds[210], $cleanupIds[211], $cleanupIds[212], $cleanupIds[213], $cleanupIds[214], $cleanupIds[215], $cleanupIds[216], $cleanupIds[217], $cleanupIds[218], $cleanupIds[219], $cleanupIds[220], $cleanupIds[221], $cleanupIds[222], $cleanupIds[223], $cleanupIds[224], $cleanupIds[225], $cleanupIds[226], $cleanupIds[227], $cleanupIds[228], $cleanupIds[229], $cleanupIds[230], $cleanupIds[231], $cleanupIds[232], $cleanupIds[233], $cleanupIds[234], $cleanupIds[235], $cleanupIds[236], $cleanupIds[237], $cleanupIds[238], $cleanupIds[239], $cleanupIds[240], $cleanupIds[241], $cleanupIds[242], $cleanupIds[243], $cleanupIds[244], $cleanupIds[245], $cleanupIds[246], $cleanupIds[247], $cleanupIds[248], $cleanupIds[249], $cleanupIds[250], $cleanupIds[251], $cleanupIds[252], $cleanupIds[253], $cleanupIds[254], $cleanupIds[255], $cleanupIds[256], $cleanupIds[257], $cleanupIds[258], $cleanupIds[259], $cleanupIds[260], $cleanupIds[261], $cleanupIds[262], $cleanupIds[263], $cleanupIds[264], $cleanupIds[265], $cleanupIds[266], $cleanupIds[267], $cleanupIds[268], $cleanupIds[269], $cleanupIds[270], $cleanupIds[271], $cleanupIds[272], $cleanupIds[273], $cleanupIds[274], $cleanupIds[275], $cleanupIds[276], $cleanupIds[277], $cleanupIds[278], $cleanupIds[279], $cleanupIds[280], $cleanupIds[281], $cleanupIds[282], $cleanupIds[283], $cleanupIds[284], $cleanupIds[285], $cleanupIds[286], $cleanupIds[287], $cleanupIds[288], $cleanupIds[289], $cleanupIds[290], $cleanupIds[291], $cleanupIds[292], $cleanupIds[293], $cleanupIds[294], $cleanupIds[295], $cleanupIds[296], $cleanupIds[297], $cleanupIds[298], $cleanupIds[299], $cleanupIds[300], $cleanupIds[301], $cleanupIds[302], $cleanupIds[303], $cleanupIds[304], $cleanupIds[305], $cleanupIds[306], $cleanupIds[307], $cleanupIds[308], $cleanupIds[309], $cleanupIds[310], $cleanupIds[311], $cleanupIds[312], $cleanupIds[313], $cleanupIds[314], $cleanupIds[315], $cleanupIds[316], $cleanupIds[317], $cleanupIds[318], $cleanupIds[319], $cleanupIds[320], $cleanupIds[321], $cleanupIds[322], $cleanupIds[323], $cleanupIds[324], $cleanupIds[325], $cleanupIds[326], $cleanupIds[327], $cleanupIds[328], $cleanupIds[329], $cleanupIds[330], $cleanupIds[331], $cleanupIds[332], $cleanupIds[333], $cleanupIds[334], $cleanupIds[335], $cleanupIds[336], $cleanupIds[337], $cleanupIds[338], $cleanupIds[339], $cleanupIds[340], $cleanupIds[341], $cleanupIds[342], $cleanupIds[343], $cleanupIds[344], $cleanupIds[345], $cleanupIds[346], $cleanupIds[347], $cleanupIds[348], $cleanupIds[349], $cleanupIds[350], $cleanupIds[351], $cleanupIds[352], $cleanupIds[353], $cleanupIds[354], $cleanupIds[355], $cleanupIds[356], $cleanupIds[357], $cleanupIds[358], $cleanupIds[359], $cleanupIds[360], $cleanupIds[361], $cleanupIds[362], $cleanupIds[363], $cleanupIds[364], $cleanupIds[365], $cleanupIds[366], $cleanupIds[367], $cleanupIds[368], $cleanupIds[369], $cleanupIds[370], $cleanupIds[371], $cleanupIds[372], $cleanupIds[373], $cleanupIds[374], $cleanupIds[375], $cleanupIds[376], $cleanupIds[377], $cleanupIds[378], $cleanupIds[379], $cleanupIds[380], $cleanupIds[381], $cleanupIds[382], $cleanupIds[383], $cleanupIds[384], $cleanupIds[385], $cleanupIds[386], $cleanupIds[387], $cleanupIds[388], $cleanupIds[389], $cleanupIds[390], $cleanupIds[391], $cleanupIds[392], $cleanupIds[393], $cleanupIds[394], $cleanupIds[395], $cleanupIds[396], $cleanupIds[397], $cleanupIds[398], $cleanupIds[399], $cleanupIds[400], $cleanupIds[401], $cleanupIds[402], $cleanupIds[403], $cleanupIds[404], $cleanupIds[405], $cleanupIds[406], $cleanupIds[407], $cleanupIds[408], $cleanupIds[409], $cleanupIds[410], $cleanupIds[411], $cleanupIds[412], $cleanupIds[413], $cleanupIds[414], $cleanupIds[415], $cleanupIds[416], $cleanupIds[417], $cleanupIds[418], $cleanupIds[419], $cleanupIds[420], $cleanupIds[421], $cleanupIds[422], $cleanupIds[423], $cleanupIds[424], $cleanupIds[425], $cleanupIds[426], $cleanupIds[427], $cleanupIds[428], $cleanupIds[429], $cleanupIds[430], $cleanupIds[431], $cleanupIds[432], $cleanupIds[433], $cleanupIds[434], $cleanupIds[435], $cleanupIds[436], $cleanupIds[437], $cleanupIds[438], $cleanupIds[439], $cleanupIds[440], $cleanupIds[441], $cleanupIds[442], $cleanupIds[443], $cleanupIds[444], $cleanupIds[445], $cleanupIds[446], $cleanupIds[447], $cleanupIds[448], $cleanupIds[449], $cleanupIds[450], $cleanupIds[451], $cleanupIds[452], $cleanupIds[453], $cleanupIds[454], $cleanupIds[455], $cleanupIds[456], $cleanupIds[457], $cleanupIds[458], $cleanupIds[459], $cleanupIds[460], $cleanupIds[461], $cleanupIds[462], $cleanupIds[463], $cleanupIds[464], $cleanupIds[465], $cleanupIds[466], $cleanupIds[467], $cleanupIds[468], $cleanupIds[469], $cleanupIds[470], $cleanupIds[471], $cleanupIds[472], $cleanupIds[473], $cleanupIds[474], $cleanupIds[475], $cleanupIds[476], $cleanupIds[477], $cleanupIds[478], $cleanupIds[479], $cleanupIds[480], $cleanupIds[481], $cleanupIds[482], $cleanupIds[483], $cleanupIds[484], $cleanupIds[485], $cleanupIds[486], $cleanupIds[487], $cleanupIds[488], $cleanupIds[489], $cleanupIds[490], $cleanupIds[491], $cleanupIds[492], $cleanupIds[493], $cleanupIds[494], $cleanupIds[495], $cleanupIds[496], $cleanupIds[497], $cleanupIds[498], $cleanupIds[499], $cleanupIds[500], $cleanupIds[501], $cleanupIds[502], $cleanupIds[503], $cleanupIds[504], $cleanupIds[505], $cleanupIds[506], $cleanupIds[507], $cleanupIds[508], $cleanupIds[509], $cleanupIds[510], $cleanupIds[511], $cleanupIds[512], $cleanupIds[513], $cleanupIds[514], $cleanupIds[515], $cleanupIds[516], $cleanupIds[517], $cleanupIds[518], $cleanupIds[519], $cleanupIds[520], $cleanupIds[521], $cleanupIds[522], $cleanupIds[523], $cleanupIds[524], $cleanupIds[525], $cleanupIds[526], $cleanupIds[527], $cleanupIds[528], $cleanupIds[529], $cleanupIds[530], $cleanupIds[531], $cleanupIds[532], $cleanupIds[533], $cleanupIds[534], $cleanupIds[535], $cleanupIds[536], $cleanupIds[537], $cleanupIds[538], $cleanupIds[539], $cleanupIds[540], $cleanupIds[541], $cleanupIds[542], $cleanupIds[543], $cleanupIds[544], $cleanupIds[545], $cleanupIds[546], $cleanupIds[547], $cleanupIds[548], $cleanupIds[549], $cleanupIds[550], $cleanupIds[551], $cleanupIds[552], $cleanupIds[553], $cleanupIds[554], $cleanupIds[555], $cleanupIds[556], $cleanupIds[557], $cleanupIds[558], $cleanupIds[559], $cleanupIds[560], $cleanupIds[561], $cleanupIds[562], $cleanupIds[563], $cleanupIds[564], $cleanupIds[565], $cleanupIds[566], $cleanupIds[567], $cleanupIds[568], $cleanupIds[569], $cleanupIds[570], $cleanupIds[571], $cleanupIds[572], $cleanupIds[573], $cleanupIds[574], $cleanupIds[575], $cleanupIds[576], $cleanupIds[577], $cleanupIds[578], $cleanupIds[579], $cleanupIds[580], $cleanupIds[581], $cleanupIds[582], $cleanupIds[583], $cleanupIds[584], $cleanupIds[585], $cleanupIds[586], $cleanupIds[587], $cleanupIds[588], $cleanupIds[589], $cleanupIds[590], $cleanupIds[591], $cleanupIds[592], $cleanupIds[593], $cleanupIds[594], $cleanupIds[595], $cleanupIds[596], $cleanupIds[597], $cleanupIds[598], $cleanupIds[599], $cleanupIds[600], $cleanupIds[601], $cleanupIds[602], $cleanupIds[603], $cleanupIds[604], $cleanupIds[605], $cleanupIds[606], $cleanupIds[607], $cleanupIds[608], $cleanupIds[609], $cleanupIds[610], $cleanupIds[611], $cleanupIds[612], $cleanupIds[613], $cleanupIds[614], $cleanupIds[615], $cleanupIds[616], $cleanupIds[617], $cleanupIds[618], $cleanupIds[619], $cleanupIds[620], $cleanupIds[621], $cleanupIds[622], $cleanupIds[623], $cleanupIds[624], $cleanupIds[625], $cleanupIds[626], $cleanupIds[627], $cleanupIds[628], $cleanupIds[629], $cleanupIds[630], $cleanupIds[631], $cleanupIds[632], $cleanupIds[633], $cleanupIds[634], $cleanupIds[635], $cleanupIds[636], $cleanupIds[637], $cleanupIds[638], $cleanupIds[639], $cleanupIds[640], $cleanupIds[641], $cleanupIds[642], $cleanupIds[643], $cleanupIds[644], $cleanupIds[645], $cleanupIds[646], $cleanupIds[647], $cleanupIds[648], $cleanupIds[649], $cleanupIds[650], $cleanupIds[651], $cleanupIds[652], $cleanupIds[653], $cleanupIds[654], $cleanupIds[655], $cleanupIds[656], $cleanupIds[657], $cleanupIds[658], $cleanupIds[659], $cleanupIds[660], $cleanupIds[661], $cleanupIds[662], $cleanupIds[663], $cleanupIds[664], $cleanupIds[665], $cleanupIds[666], $cleanupIds[667], $cleanupIds[668], $cleanupIds[669], $cleanupIds[670], $cleanupIds[671], $cleanupIds[672], $cleanupIds[673], $cleanupIds[674], $cleanupIds[675], $cleanupIds[676], $cleanupIds[677], $cleanupIds[678], $cleanupIds[679], $cleanupIds[680], $cleanupIds[681], $cleanupIds[682], $cleanupIds[683], $cleanupIds[684], $cleanupIds[685], $cleanupIds[686], $cleanupIds[687], $cleanupIds[688], $cleanupIds[689], $cleanupIds[690], $cleanupIds[691], $cleanupIds[692], $cleanupIds[693], $cleanupIds[694], $cleanupIds[695], $cleanupIds[696], $cleanupIds[697], $cleanupIds[698], $cleanupIds[699], $cleanupIds[700], $cleanupIds[701], $cleanupIds[702], $cleanupIds[703], $cleanupIds[704], $cleanupIds[705], $cleanupIds[706], $cleanupIds[707], $cleanupIds[708], $cleanupIds[709], $cleanupIds[710], $cleanupIds[711], $cleanupIds[712], $cleanupIds[713], $cleanupIds[714], $cleanupIds[715], $cleanupIds[716], $cleanupIds[717], $cleanupIds[718], $cleanupIds[719], $cleanupIds[720], $cleanupIds[721], $cleanupIds[722], $cleanupIds[723], $cleanupIds[724], $cleanupIds[725], $cleanupIds[726], $cleanupIds[727], $cleanupIds[728], $cleanupIds[729], $cleanupIds[730], $cleanupIds[731], $cleanupIds[732], $cleanupIds[733], $cleanupIds[734], $cleanupIds[735], $cleanupIds[736], $cleanupIds[737], $cleanupIds[738], $cleanupIds[739], $cleanupIds[740], $cleanupIds[741], $cleanupIds[742], $cleanupIds[743], $cleanupIds[744], $cleanupIds[745], $cleanupIds[746], $cleanupIds[747], $cleanupIds[748], $cleanupIds[749], $cleanupIds[750], $cleanupIds[751], $cleanupIds[752], $cleanupIds[753], $cleanupIds[754], $cleanupIds[755], $cleanupIds[756], $cleanupIds[757], $cleanupIds[758], $cleanupIds[759], $cleanupIds[760], $cleanupIds[761], $cleanupIds[762], $cleanupIds[763], $cleanupIds[764], $cleanupIds[765], $cleanupIds[766], $cleanupIds[767], $cleanupIds[768], $cleanupIds[769], $cleanupIds[770], $cleanupIds[771], $cleanupIds[772], $cleanupIds[773], $cleanupIds[774], $cleanupIds[775], $cleanupIds[776], $cleanupIds[777], $cleanupIds[778], $cleanupIds[779], $cleanupIds[780], $cleanupIds[781], $cleanupIds[782], $cleanupIds[783], $cleanupIds[784], $cleanupIds[785], $cleanupIds[786], $cleanupIds[787], $cleanupIds[788], $cleanupIds[789], $cleanupIds[790], $cleanupIds[791], $cleanupIds[792], $cleanupIds[793], $cleanupIds[794], $cleanupIds[795], $cleanupIds[796], $cleanupIds[797], $cleanupIds[798], $cleanupIds[799], $cleanupIds[800], $cleanupIds[801], $cleanupIds[802], $cleanupIds[803], $cleanupIds[804], $cleanupIds[805], $cleanupIds[806], $cleanupIds[807], $cleanupIds[808], $cleanupIds[809], $cleanupIds[810], $cleanupIds[811], $cleanupIds[812], $cleanupIds[813], $cleanupIds[814], $cleanupIds[815], $cleanupIds[816], $cleanupIds[817], $cleanupIds[818], $cleanupIds[819], $cleanupIds[820], $cleanupIds[821], $cleanupIds[822], $cleanupIds[823], $cleanupIds[824], $cleanupIds[825], $cleanupIds[826], $cleanupIds[827], $cleanupIds[828], $cleanupIds[829], $cleanupIds[830], $cleanupIds[831], $cleanupIds[832], $cleanupIds[833], $cleanupIds[834], $cleanupIds[835], $cleanupIds[836], $cleanupIds[837], $cleanupIds[838], $cleanupIds[839], $cleanupIds[840], $cleanupIds[841], $cleanupIds[842], $cleanupIds[843], $cleanupIds[844], $cleanupIds[845], $cleanupIds[846], $cleanupIds[847], $cleanupIds[848], $cleanupIds[849], $cleanupIds[850], $cleanupIds[851], $cleanupIds[852], $cleanupIds[853], $cleanupIds[854], $cleanupIds[855], $cleanupIds[856], $cleanupIds[857], $cleanupIds[858], $cleanupIds[859], $cleanupIds[860], $cleanupIds[861], $cleanupIds[862], $cleanupIds[863], $cleanupIds[864], $cleanupIds[865], $cleanupIds[866], $cleanupIds[867], $cleanupIds[868], $cleanupIds[869], $cleanupIds[870], $cleanupIds[871], $cleanupIds[872], $cleanupIds[873], $cleanupIds[874], $cleanupIds[875], $cleanupIds[876], $cleanupIds[877], $cleanupIds[878], $cleanupIds[879], $cleanupIds[880], $cleanupIds[881], $cleanupIds[882], $cleanupIds[883], $cleanupIds[884], $cleanupIds[885], $cleanupIds[886], $cleanupIds[887], $cleanupIds[888], $cleanupIds[889], $cleanupIds[890], $cleanupIds[891], $cleanupIds[892], $cleanupIds[893], $cleanupIds[894], $cleanupIds[895], $cleanupIds[896], $cleanupIds[897], $cleanupIds[898], $cleanupIds[899], $cleanupIds[900], $cleanupIds[901], $cleanupIds[902], $cleanupIds[903], $cleanupIds[904], $cleanupIds[905], $cleanupIds[906], $cleanupIds[907], $cleanupIds[908], $cleanupIds[909], $cleanupIds[910], $cleanupIds[911], $cleanupIds[912], $cleanupIds[913], $cleanupIds[914], $cleanupIds[915], $cleanupIds[916], $cleanupIds[917], $cleanupIds[918], $cleanupIds[919], $cleanupIds[920], $cleanupIds[921], $cleanupIds[922], $cleanupIds[923], $cleanupIds[924], $cleanupIds[925], $cleanupIds[926], $cleanupIds[927], $cleanupIds[928], $cleanupIds[929], $cleanupIds[930], $cleanupIds[931], $cleanupIds[932], $cleanupIds[933], $cleanupIds[934], $cleanupIds[935], $cleanupIds[936], $cleanupIds[937], $cleanupIds[938], $cleanupIds[939], $cleanupIds[940], $cleanupIds[941], $cleanupIds[942], $cleanupIds[943], $cleanupIds[944], $cleanupIds[945], $cleanupIds[946], $cleanupIds[947], $cleanupIds[948], $cleanupIds[949], $cleanupIds[950], $cleanupIds[951], $cleanupIds[952], $cleanupIds[953], $cleanupIds[954], $cleanupIds[955], $cleanupIds[956], $cleanupIds[957], $cleanupIds[958], $cleanupIds[959], $cleanupIds[960], $cleanupIds[961], $cleanupIds[962], $cleanupIds[963], $cleanupIds[964], $cleanupIds[965], $cleanupIds[966], $cleanupIds[967], $cleanupIds[968], $cleanupIds[969], $cleanupIds[970], $cleanupIds[971], $cleanupIds[972], $cleanupIds[973], $cleanupIds[974], $cleanupIds[975], $cleanupIds[976], $cleanupIds[977], $cleanupIds[978], $cleanupIds[979], $cleanupIds[980], $cleanupIds[981], $cleanupIds[982], $cleanupIds[983], $cleanupIds[984], $cleanupIds[985], $cleanupIds[986], $cleanupIds[987], $cleanupIds[988], $cleanupIds[989], $cleanupIds[990], $cleanupIds[991], $cleanupIds[992], $cleanupIds[993], $cleanupIds[994], $cleanupIds[995], $cleanupIds[996], $cleanupIds[997], $cleanupIds[998], $cleanupIds[999], $cleanupIds[1000], $cleanupIds[1001], $cleanupIds[1002], $cleanupIds[1003], $cleanupIds[1004], $cleanupIds[1005], $cleanupIds[1006], $cleanupIds[1007], $cleanupIds[1008], $cleanupIds[1009], $cleanupIds[1010], $cleanupIds[1011], $cleanupIds[1012], $cleanupIds[1013], $cleanupIds[1014], $cleanupIds[1015], $cleanupIds[1016], $cleanupIds[1017], $cleanupIds[1018], $cleanupIds[1019], $cleanupIds[1020], $cleanupIds[1021], $cleanupIds[1022], $cleanupIds[1023], $cleanupIds[1024], $cleanupIds[1025], $cleanupIds[1026], $cleanupIds[1027], $cleanupIds[1028], $cleanupIds[1029], $cleanupIds[1030], $cleanupIds[1031], $cleanupIds[1032], $cleanupIds[1033], $cleanupIds[1034], $cleanupIds[1035], $cleanupIds[1036], $cleanupIds[1037], $cleanupIds[1038], $cleanupIds[1039], $cleanupIds[1040], $cleanupIds[1041], $cleanupIds[1042], $cleanupIds[1043], $cleanupIds[1044], $cleanupIds[1045], $cleanupIds[1046], $cleanupIds[1047], $cleanupIds[1048], $cleanupIds[1049], $cleanupIds[1050], $cleanupIds[1051], $cleanupIds[1052], $cleanupIds[1053], $cleanupIds[1054], $cleanupIds[1055], $cleanupIds[1056], $cleanupIds[1057], $cleanupIds[1058], $cleanupIds[1059], $cleanupIds[1060], $cleanupIds[1061], $cleanupIds[1062], $cleanupIds[1063], $cleanupIds[1064], $cleanupIds[1065], $cleanupIds[1066], $cleanupIds[1067], $cleanupIds[1068], $cleanupIds[1069], $cleanupIds[1070], $cleanupIds[1071], $cleanupIds[1072], $cleanupIds[1073], $cleanupIds[1074], $cleanupIds[1075], $cleanupIds[1076], $cleanupIds[1077], $cleanupIds[1078], $cleanupIds[1079], $cleanupIds[1080], $cleanupIds[1081], $cleanupIds[1082], $cleanupIds[1083], $cleanupIds[1084], $cleanupIds[1085], $cleanupIds[1086], $cleanupIds[1087], $cleanupIds[1088], $cleanupIds[1089], $cleanupIds[1090], $cleanupIds[1091], $cleanupIds[1092], $cleanupIds[1093], $cleanupIds[1094], $cleanupIds[1095], $cleanupIds[1096], $cleanupIds[1097], $cleanupIds[1098], $cleanupIds[1099], $cleanupIds[1100], $cleanupIds[1101], $cleanupIds[1102], $cleanupIds[1103], $cleanupIds[1104], $cleanupIds[1105], $cleanupIds[1106], $cleanupIds[1107], $cleanupIds[1108], $cleanupIds[1109], $cleanupIds[1110], $cleanupIds[1111], $cleanupIds[1112], $cleanupIds[1113], $cleanupIds[1114], $cleanupIds[1115], $cleanupIds[1116], $cleanupIds[1117], $cleanupIds[1118], $cleanupIds[1119], $cleanupIds[1120], $cleanupIds[1121], $cleanupIds[1122], $cleanupIds[1123], $cleanupIds[1124], $cleanupIds[1125], $cleanupIds[1126], $cleanupIds[1127], $cleanupIds[1128], $cleanupIds[1129], $cleanupIds[1130], $cleanupIds[1131], $cleanupIds[1132], $cleanupIds[1133], $cleanupIds[1134], $cleanupIds[1135], $cleanupIds[1136], $cleanupIds[1137], $cleanupIds[1138], $cleanupIds[1139], $cleanupIds[1140], $cleanupIds[1141], $cleanupIds[1142], $cleanupIds[1143], $cleanupIds[1144], $cleanupIds[1145], $cleanupIds[1146], $cleanupIds[1147], $cleanupIds[1148], $cleanupIds[1149], $cleanupIds[1150], $cleanupIds[1151], $cleanupIds[1152], $cleanupIds[1153], $cleanupIds[1154], $cleanupIds[1155], $cleanupIds[1156], $cleanupIds[1157], $cleanupIds[1158], $cleanupIds[1159], $cleanupIds[1160], $cleanupIds[1161], $cleanupIds[1162], $cleanupIds[1163], $cleanupIds[1164], $cleanupIds[1165], $cleanupIds[1166], $cleanupIds[1167], $cleanupIds[1168], $cleanupIds[1169], $cleanupIds[1170], $cleanupIds[1171], $cleanupIds[1172], $cleanupIds[1173], $cleanupIds[1174], $cleanupIds[1175], $cleanupIds[1176], $cleanupIds[1177], $cleanupIds[1178], $cleanupIds[1179], $cleanupIds[1180], $cleanupIds[1181], $cleanupIds[1182], $cleanupIds[1183], $cleanupIds[1184], $cleanupIds[1185], $cleanupIds[1186], $cleanupIds[1187], $cleanupIds[1188], $cleanupIds[1189], $cleanupIds[1190], $cleanupIds[1191], $cleanupIds[1192], $cleanupIds[1193], $cleanupIds[1194], $cleanupIds[1195], $cleanupIds[1196], $cleanupIds[1197], $cleanupIds[1198], $cleanupIds[1199], $cleanupIds[1200], $cleanupIds[1201], $cleanupIds[1202], $cleanupIds[1203], $cleanupIds[1204], $cleanupIds[1205], $cleanupIds[1206], $cleanupIds[1207], $cleanupIds[1208], $cleanupIds[1209], $cleanupIds[1210], $cleanupIds[1211], $cleanupIds[1212], $cleanupIds[1213], $cleanupIds[1214], $cleanupIds[1215], $cleanupIds[1216], $cleanupIds[1217], $cleanupIds[1218], $cleanupIds[1219], $cleanupIds[1220], $cleanupIds[1221], $cleanupIds[1222], $cleanupIds[1223], $cleanupIds[1224], $cleanupIds[1225], $cleanupIds[1226], $cleanupIds[1227], $cleanupIds[1228], $cleanupIds[1229], $cleanupIds[1230], $cleanupIds[1231], $cleanupIds[1232], $cleanupIds[1233], $cleanupIds[1234], $cleanupIds[1235], $cleanupIds[1236], $cleanupIds[1237], $cleanupIds[1238], $cleanupIds[1239], $cleanupIds[1240], $cleanupIds[1241], $cleanupIds[1242], $cleanupIds[1243], $cleanupIds[1244], $cleanupIds[1245], $cleanupIds[1246], $cleanupIds[1247], $cleanupIds[1248], $cleanupIds[1249], $cleanupIds[1250], $cleanupIds[1251], $cleanupIds[1252], $cleanupIds[1253], $cleanupIds[1254], $cleanupIds[1255], $cleanupIds[1256], $cleanupIds[1257], $cleanupIds[1258], $cleanupIds[1259], $cleanupIds[1260], $cleanupIds[1261], $cleanupIds[1262], $cleanupIds[1263], $cleanupIds[1264], $cleanupIds[1265], $cleanupIds[1266], $cleanupIds[1267], $cleanupIds[1268], $cleanupIds[1269], $cleanupIds[1270], $cleanupIds[1271], $cleanupIds[1272], $cleanupIds[1273], $cleanupIds[1274], $cleanupIds[1275], $cleanupIds[1276], $cleanupIds[1277], $cleanupIds[1278], $cleanupIds[1279], $cleanupIds[1280], $cleanupIds[1281], $cleanupIds[1282], $cleanupIds[1283], $cleanupIds[1284], $cleanupIds[1285], $cleanupIds[1286], $cleanupIds[1287], $cleanupIds[1288], $cleanupIds[1289], $cleanupIds[1290], $cleanupIds[1291], $cleanupIds[1292], $cleanupIds[1293], $cleanupIds[1294], $cleanupIds[1295], $cleanupIds[1296], $cleanupIds[1297], $cleanupIds[1298], $cleanupIds[1299], $cleanupIds[1300], $cleanupIds[1301], $cleanupIds[1302], $cleanupIds[1303], $cleanupIds[1304], $cleanupIds[1305], $cleanupIds[1306], $cleanupIds[1307], $cleanupIds[1308], $cleanupIds[1309], $cleanupIds[1310], $cleanupIds[1311], $cleanupIds[1312], $cleanupIds[1313], $cleanupIds[1314], $cleanupIds[1315], $cleanupIds[1316], $cleanupIds[1317], $cleanupIds[1318], $cleanupIds[1319], $cleanupIds[1320], $cleanupIds[1321], $cleanupIds[1322], $cleanupIds[1323], $cleanupIds[1324], $cleanupIds[1325], $cleanupIds[1326], $cleanupIds[1327], $cleanupIds[1328], $cleanupIds[1329], $cleanupIds[1330], $cleanupIds[1331], $cleanupIds[1332], $cleanupIds[1333], $cleanupIds[1334], $cleanupIds[1335], $cleanupIds[1336], $cleanupIds[1337], $cleanupIds[1338], $cleanupIds[1339], $cleanupIds[1340], $cleanupIds[1341], $cleanupIds[1342], $cleanupIds[1343], $cleanupIds[1344], $cleanupIds[1345], $cleanupIds[1346], $cleanupIds[1347], $cleanupIds[1348], $cleanupIds[1349], $cleanupIds[1350], $cleanupIds[1351], $cleanupIds[1352], $cleanupIds[1353], $cleanupIds[1354], $cleanupIds[1355], $cleanupIds[1356], $cleanupIds[1357], $cleanupIds[1358], $cleanupIds[1359], $cleanupIds[1360], $cleanupIds[1361], $cleanupIds[1362], $cleanupIds[1363], $cleanupIds[1364], $cleanupIds[1365], $cleanupIds[1366], $cleanupIds[1367], $cleanupIds[1368], $cleanupIds[1369], $cleanupIds[1370], $cleanupIds[1371], $cleanupIds[1372], $cleanupIds[1373], $cleanupIds[1374], $cleanupIds[1375], $cleanupIds[1376], $cleanupIds[1377], $cleanupIds[1378], $cleanupIds[1379], $cleanupIds[1380], $cleanupIds[1381], $cleanupIds[1382], $cleanupIds[1383], $cleanupIds[1384], $cleanupIds[1385], $cleanupIds[1386], $cleanupIds[1387], $cleanupIds[1388], $cleanupIds[1389], $cleanupIds[1390], $cleanupIds[1391], $cleanupIds[1392], $cleanupIds[1393], $cleanupIds[1394], $cleanupIds[1395], $cleanupIds[1396], $cleanupIds[1397], $cleanupIds[1398], $cleanupIds[1399], $cleanupIds[1400], $cleanupIds[1401], $cleanupIds[1402], $cleanupIds[1403], $cleanupIds[1404], $cleanupIds[1405], $cleanupIds[1406], $cleanupIds[1407], $cleanupIds[1408], $cleanupIds[1409], $cleanupIds[1410], $cleanupIds[1411], $cleanupIds[1412], $cleanupIds[1413], $cleanupIds[1414], $cleanupIds[1415], $cleanupIds[1416], $cleanupIds[1417], $cleanupIds[1418], $cleanupIds[1419], $cleanupIds[1420], $cleanupIds[1421], $cleanupIds[1422], $cleanupIds[1423], $cleanupIds[1424], $cleanupIds[1425], $cleanupIds[1426], $cleanupIds[1427], $cleanupIds[1428], $cleanupIds[1429], $cleanupIds[1430], $cleanupIds[1431], $cleanupIds[1432], $cleanupIds[1433], $cleanupIds[1434], $cleanupIds[1435], $cleanupIds[1436], $cleanupIds[1437], $cleanupIds[1438], $cleanupIds[1439], $cleanupIds[1440], $cleanupIds[1441], $cleanupIds[1442], $cleanupIds[1443], $cleanupIds[1444], $cleanupIds[1445], $cleanupIds[1446], $cleanupIds[1447], $cleanupIds[1448], $cleanupIds[1449], $cleanupIds[1450], $cleanupIds[1451], $cleanupIds[1452], $cleanupIds[1453], $cleanupIds[1454], $cleanupIds[1455], $cleanupIds[1456], $cleanupIds[1457], $cleanupIds[1458], $cleanupIds[1459], $cleanupIds[1460], $cleanupIds[1461], $cleanupIds[1462], $cleanupIds[1463], $cleanupIds[1464], $cleanupIds[1465], $cleanupIds[1466], $cleanupIds[1467], $cleanupIds[1468], $cleanupIds[1469], $cleanupIds[1470], $cleanupIds[1471], $cleanupIds[1472], $cleanupIds[1473], $cleanupIds[1474], $cleanupIds[1475], $cleanupIds[1476], $cleanupIds[1477], $cleanupIds[1478], $cleanupIds[1479], $cleanupIds[1480], $cleanupIds[1481], $cleanupIds[1482], $cleanupIds[1483], $cleanupIds[1484], $cleanupIds[1485], $cleanupIds[1486], $cleanupIds[1487], $cleanupIds[1488], $cleanupIds[1489], $cleanupIds[1490], $cleanupIds[1491], $cleanupIds[1492], $cleanupIds[1493], $cleanupIds[1494], $cleanupIds[1495], $cleanupIds[1496], $cleanupIds[1497], $cleanupIds[1498], $cleanupIds[1499], $cleanupIds[1500], $cleanupIds[1501], $cleanupIds[1502], $cleanupIds[1503], $cleanupIds[1504], $cleanupIds[1505], $cleanupIds[1506], $cleanupIds[1507], $cleanupIds[1508], $cleanupIds[1509], $cleanupIds[1510], $cleanupIds[1511], $cleanupIds[1512], $cleanupIds[1513], $cleanupIds[1514], $cleanupIds[1515], $cleanupIds[1516], $cleanupIds[1517], $cleanupIds[1518], $cleanupIds[1519], $cleanupIds[1520], $cleanupIds[1521], $cleanupIds[1522], $cleanupIds[1523], $cleanupIds[1524], $cleanupIds[1525], $cleanupIds[1526], $cleanupIds[1527], $cleanupIds[1528], $cleanupIds[1529], $cleanupIds[1530], $cleanupIds[1531], $cleanupIds[1532], $cleanupIds[1533], $cleanupIds[1534], $cleanupIds[1535], $cleanupIds[1536], $cleanupIds[1537], $cleanupIds[1538], $cleanupIds[1539], $cleanupIds[1540], $cleanupIds[1541], $cleanupIds[1542], $cleanupIds[1543], $cleanupIds[1544], $cleanupIds[1545], $cleanupIds[1546], $cleanupIds[1547], $cleanupIds[1548], $cleanupIds[1549], $cleanupIds[1550], $cleanupIds[1551], $cleanupIds[1552], $cleanupIds[1553], $cleanupIds[1554], $cleanupIds[1555], $cleanupIds[1556], $cleanupIds[1557], $cleanupIds[1558], $cleanupIds[1559], $cleanupIds[1560], $cleanupIds[1561], $cleanupIds[1562], $cleanupIds[1563], $cleanupIds[1564], $cleanupIds[1565], $cleanupIds[1566], $cleanupIds[1567], $cleanupIds[1568], $cleanupIds[1569], $cleanupIds[1570], $cleanupIds[1571], $cleanupIds[1572], $cleanupIds[1573], $cleanupIds[1574], $cleanupIds[1575], $cleanupIds[1576], $cleanupIds[1577], $cleanupIds[1578], $cleanupIds[1579], $cleanupIds[1580], $cleanupIds[1581], $cleanupIds[1582], $cleanupIds[1583], $cleanupIds[1584], $cleanupIds[1585], $cleanupIds[1586], $cleanupIds[1587], $cleanupIds[1588], $cleanupIds[1589], $cleanupIds[1590], $cleanupIds[1591], $cleanupIds[1592], $cleanupIds[1593], $cleanupIds[1594], $cleanupIds[1595], $cleanupIds[1596], $cleanupIds[1597], $cleanupIds[1598], $cleanupIds[1599], $cleanupIds[1600], $cleanupIds[1601], $cleanupIds[1602], $cleanupIds[1603], $cleanupIds[1604], $cleanupIds[1605], $cleanupIds[1606], $cleanupIds[1607], $cleanupIds[1608], $cleanupIds[1609], $cleanupIds[1610], $cleanupIds[1611], $cleanupIds[1612], $cleanupIds[1613], $cleanupIds[1614], $cleanupIds[1615], $cleanupIds[1616], $cleanupIds[1617], $cleanupIds[1618], $cleanupIds[1619], $cleanupIds[1620], $cleanupIds[1621], $cleanupIds[1622], $cleanupIds[1623], $cleanupIds[1624], $cleanupIds[1625], $cleanupIds[1626], $cleanupIds[1627], $cleanupIds[1628], $cleanupIds[1629], $cleanupIds[1630], $cleanupIds[1631], $cleanupIds[1632], $cleanupIds[1633], $cleanupIds[1634], $cleanupIds[1635], $cleanupIds[1636], $cleanupIds[1637], $cleanupIds[1638], $cleanupIds[1639], $cleanupIds[1640], $cleanupIds[1641], $cleanupIds[1642], $cleanupIds[1643], $cleanupIds[1644], $cleanupIds[1645], $cleanupIds[1646], $cleanupIds[1647], $cleanupIds[1648], $cleanupIds[1649], $cleanupIds[1650], $cleanupIds[1651], $cleanupIds[1652], $cleanupIds[1653], $cleanupIds[1654], $cleanupIds[1655], $cleanupIds[1656], $cleanupIds[1657], $cleanupIds[1658], $cleanupIds[1659], $cleanupIds[1660], $cleanupIds[1661], $cleanupIds[1662], $cleanupIds[1663], $cleanupIds[1664], $cleanupIds[1665], $cleanupIds[1666], $cleanupIds[1667], $cleanupIds[1668], $cleanupIds[1669], $cleanupIds[1670], $cleanupIds[1671], $cleanupIds[1672], $cleanupIds[1673], $cleanupIds[1674], $cleanupIds[1675], $cleanupIds[1676], $cleanupIds[1677], $cleanupIds[1678], $cleanupIds[1679], $cleanupIds[1680], $cleanupIds[1681], $cleanupIds[1682], $cleanupIds[1683], $cleanupIds[1684], $cleanupIds[1685], $cleanupIds[1686], $cleanupIds[1687], $cleanupIds[1688], $cleanupIds[1689], $cleanupIds[1690], $cleanupIds[1691], $cleanupIds[1692], $cleanupIds[1693], $cleanupIds[1694], $cleanupIds[1695], $cleanupIds[1696], $cleanupIds[1697], $cleanupIds[1698], $cleanupIds[1699], $cleanupIds[1700], $cleanupIds[1701], $cleanupIds[1702], $cleanupIds[1703], $cleanupIds[1704], $cleanupIds[1705], $cleanupIds[1706], $cleanupIds[1707], $cleanupIds[1708], $cleanupIds[1709], $cleanupIds[1710], $cleanupIds[1711], $cleanupIds[1712], $cleanupIds[1713], $cleanupIds[1714], $cleanupIds[1715], $cleanupIds[1716], $cleanupIds[1717], $cleanupIds[1718], $cleanupIds[1719], $cleanupIds[1720], $cleanupIds[1721], $cleanupIds[1722], $cleanupIds[1723], $cleanupIds[1724], $cleanupIds[1725], $cleanupIds[1726], $cleanupIds[1727], $cleanupIds[1728], $cleanupIds[1729], $cleanupIds[1730], $cleanupIds[1731], $cleanupIds[1732], $cleanupIds[1733], $cleanupIds[1734], $cleanupIds[1735], $cleanupIds[1736], $cleanupIds[1737], $cleanupIds[1738], $cleanupIds[1739], $cleanupIds[1740], $cleanupIds[1741], $cleanupIds[1742], $cleanupIds[1743], $cleanupIds[1744], $cleanupIds[1745], $cleanupIds[1746], $cleanupIds[1747], $cleanupIds[1748], $cleanupIds[1749], $cleanupIds[1750], $cleanupIds[1751], $cleanupIds[1752], $cleanupIds[1753], $cleanupIds[1754], $cleanupIds[1755], $cleanupIds[1756], $cleanupIds[1757], $cleanupIds[1758], $cleanupIds[1759], $cleanupIds[1760], $cleanupIds[1761], $cleanupIds[1762], $cleanupIds[1763], $cleanupIds[1764], $cleanupIds[1765], $cleanupIds[1766], $cleanupIds[1767], $cleanupIds[1768], $cleanupIds[1769], $cleanupIds[1770], $cleanupIds[1771], $cleanupIds[1772], $cleanupIds[1773], $cleanupIds[1774], $cleanupIds[1775], $cleanupIds[1776], $cleanupIds[1777], $cleanupIds[1778], $cleanupIds[1779], $cleanupIds[1780], $cleanupIds[1781], $cleanupIds[1782], $cleanupIds[1783], $cleanupIds[1784], $cleanupIds[1785], $cleanupIds[1786], $cleanupIds[1787], $cleanupIds[1788], $cleanupIds[1789], $cleanupIds[1790], $cleanupIds[1791], $cleanupIds[1792], $cleanupIds[1793], $cleanupIds[1794], $cleanupIds[1795], $cleanupIds[1796], $cleanupIds[1797], $cleanupIds[1798], $cleanupIds[1799], $cleanupIds[1800], $cleanupIds[1801], $cleanupIds[1802], $cleanupIds[1803], $cleanupIds[1804], $cleanupIds[1805], $cleanupIds[1806], $cleanupIds[1807], $cleanupIds[1808], $cleanupIds[1809], $cleanupIds[1810], $cleanupIds[1811], $cleanupIds[1812], $cleanupIds[1813], $cleanupIds[1814], $cleanupIds[1815], $cleanupIds[1816], $cleanupIds[1817], $cleanupIds[1818], $cleanupIds[1819], $cleanupIds[1820], $cleanupIds[1821], $cleanupIds[1822], $cleanupIds[1823], $cleanupIds[1824], $cleanupIds[1825], $cleanupIds[1826], $cleanupIds[1827], $cleanupIds[1828], $cleanupIds[1829], $cleanupIds[1830], $cleanupIds[1831], $cleanupIds[1832], $cleanupIds[1833], $cleanupIds[1834], $cleanupIds[1835], $cleanupIds[1836], $cleanupIds[1837], $cleanupIds[1838], $cleanupIds[1839], $cleanupIds[1840], $cleanupIds[1841], $cleanupIds[1842], $cleanupIds[1843], $cleanupIds[1844], $cleanupIds[1845], $cleanupIds[1846], $cleanupIds[1847], $cleanupIds[1848], $cleanupIds[1849], $cleanupIds[1850], $cleanupIds[1851], $cleanupIds[1852], $cleanupIds[1853], $cleanupIds[1854], $cleanupIds[1855], $cleanupIds[1856], $cleanupIds[1857], $cleanupIds[1858], $cleanupIds[1859], $cleanupIds[1860], $cleanupIds[1861], $cleanupIds[1862], $cleanupIds[1863], $cleanupIds[1864], $cleanupIds[1865], $cleanupIds[1866], $cleanupIds[1867], $cleanupIds[1868], $cleanupIds[1869], $cleanupIds[1870], $cleanupIds[1871], $cleanupIds[1872], $cleanupIds[1873], $cleanupIds[1874], $cleanupIds[1875], $cleanupIds[1876], $cleanupIds[1877], $cleanupIds[1878], $cleanupIds[1879], $cleanupIds[1880], $cleanupIds[1881], $cleanupIds[1882], $cleanupIds[1883], $cleanupIds[1884], $cleanupIds[1885], $cleanupIds[1886], $cleanupIds[1887], $cleanupIds[1888], $cleanupIds[1889], $cleanupIds[1890], $cleanupIds[1891], $cleanupIds[1892], $cleanupIds[1893], $cleanupIds[1894], $cleanupIds[1895], $cleanupIds[1896], $cleanupIds[1897], $cleanupIds[1898], $cleanupIds[1899], $cleanupIds[1900], $cleanupIds[1901], $cleanupIds[1902], $cleanupIds[1903], $cleanupIds[1904], $cleanupIds[1905], $cleanupIds[1906], $cleanupIds[1907], $cleanupIds[1908], $cleanupIds[1909], $cleanupIds[1910], $cleanupIds[1911], $cleanupIds[1912], $cleanupIds[1913], $cleanupIds[1914], $cleanupIds[1915], $cleanupIds[1916], $cleanupIds[1917], $cleanupIds[1918], $cleanupIds[1919], $cleanupIds[1920], $cleanupIds[1921], $cleanupIds[1922], $cleanupIds[1923], $cleanupIds[1924], $cleanupIds[1925], $cleanupIds[1926], $cleanupIds[1927], $cleanupIds[1928], $cleanupIds[1929], $cleanupIds[1930], $cleanupIds[1931], $cleanupIds[1932], $cleanupIds[1933], $cleanupIds[1934], $cleanupIds[1935], $cleanupIds[1936], $cleanupIds[1937], $cleanupIds[1938], $cleanupIds[1939], $cleanupIds[1940], $cleanupIds[1941], $cleanupIds[1942], $cleanupIds[1943], $cleanupIds[1944], $cleanupIds[1945], $cleanupIds[1946], $cleanupIds[1947], $cleanupIds[1948], $cleanupIds[1949], $cleanupIds[1950], $cleanupIds[1951], $cleanupIds[1952], $cleanupIds[1953], $cleanupIds[1954], $cleanupIds[1955], $cleanupIds[1956], $cleanupIds[1957], $cleanupIds[1958], $cleanupIds[1959], $cleanupIds[1960], $cleanupIds[1961], $cleanupIds[1962], $cleanupIds[1963], $cleanupIds[1964], $cleanupIds[1965], $cleanupIds[1966], $cleanupIds[1967], $cleanupIds[1968], $cleanupIds[1969], $cleanupIds[1970], $cleanupIds[1971], $cleanupIds[1972], $cleanupIds[1973], $cleanupIds[1974], $cleanupIds[1975], $cleanupIds[1976], $cleanupIds[1977], $cleanupIds[1978], $cleanupIds[1979], $cleanupIds[1980], $cleanupIds[1981], $cleanupIds[1982], $cleanupIds[1983], $cleanupIds[1984], $cleanupIds[1985], $cleanupIds[1986], $cleanupIds[1987], $cleanupIds[1988], $cleanupIds[1989], $cleanupIds[1990], $cleanupIds[1991], $cleanupIds[1992], $cleanupIds[1993], $cleanupIds[1994], $cleanupIds[1995], $cleanupIds[1996], $cleanupIds[1997], $cleanupIds[1998], $cleanupIds[1999], $cleanupIds[2000], $cleanupIds[2001], $cleanupIds[2002], $cleanupIds[2003], $cleanupIds[2004], $cleanupIds[2005], $cleanupIds[2006]); + + /* execute query */ + $stmt->execute(); + + /* close statement */ + $stmt->close(); + } + + mysqli_close($link); + print "done!"; +?> +--CLEAN-- +<?php + require_once("clean_table.inc"); +?> +--EXPECTF-- +done! diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 90c2b73ea..843e52d38 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1061,7 +1061,7 @@ static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len TSRMLS_DC) { size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, send_query); - enum_func_status ret; + enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::send_query"); DBG_INF_FMT("conn=%llu query=%s", conn->thread_id, query); @@ -1142,6 +1142,7 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd TSRMLS_DC) { php_socket_t this_fd; + php_stream *stream = NULL; int cnt = 0; MYSQLND **p = conn_array; @@ -1151,7 +1152,8 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p * when casting. It is only used here so that the buffered data warning * is not displayed. * */ - if (SUCCESS == php_stream_cast((*p)->data->net->stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, + stream = (*p)->data->net->stream; + if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { PHP_SAFE_FD_SET(this_fd, fds); @@ -1169,6 +1171,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds TSRMLS_DC) { php_socket_t this_fd; + php_stream *stream = NULL; int ret = 0; zend_bool disproportion = FALSE; @@ -1176,7 +1179,8 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds MYSQLND **fwd = conn_array, **bckwd = conn_array; while (*fwd) { - if (SUCCESS == php_stream_cast((*fwd)->data->net->stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, + stream = (*fwd)->data->net->stream; + if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { if (PHP_SAFE_FD_ISSET(this_fd, fds)) { if (disproportion) { @@ -1337,7 +1341,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c } if (FAIL == result->m.read_result_metadata(result, conn TSRMLS_CC)) { - DBG_ERR("Error ocurred while reading metadata"); + DBG_ERR("Error occurred while reading metadata"); result->m.free_result(result, TRUE TSRMLS_CC); result = NULL; break; @@ -1468,7 +1472,7 @@ static ulong MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC) { size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, escape_string); - ulong ret; + ulong ret = FAIL; DBG_ENTER("mysqlnd_conn_data::escape_string"); DBG_INF_FMT("conn=%llu", conn->thread_id); diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c index 21241b3ef..77e119641 100644 --- a/ext/mysqlnd/mysqlnd_net.c +++ b/ext/mysqlnd/mysqlnd_net.c @@ -758,7 +758,7 @@ MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum /* Switch to non-blocking mode and try to consume something from the line, if possible, then continue. This saves us from looking for - the actuall place where out-of-order packets have been sent. + the actual place where out-of-order packets have been sent. If someone is completely sure that everything is fine, he can switch it off. */ diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index 5ead1b0bc..cee0be181 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -626,6 +626,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar *p += null_count; } + left = (*buf_len - (*p - *buf)); /* 1. Store type information */ /* check if need to send the types even if stmt->send_types_to_server is 0. This is because diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 2e289062a..fd2023cd1 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -497,7 +497,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s mnd_efree(conn->current_result); conn->current_result = NULL; } - DBG_ERR("Error ocurred while reading metadata"); + DBG_ERR("Error occurred while reading metadata"); break; } @@ -509,7 +509,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s break; } if (FAIL == (ret = PACKET_READ(fields_eof, conn))) { - DBG_ERR("Error ocurred while reading the EOF packet"); + DBG_ERR("Error occurred while reading the EOF packet"); result->m.free_result_contents(result TSRMLS_CC); mnd_efree(result); if (!stmt) { @@ -1510,6 +1510,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, unsigned int flags mysqlnd_array_init(return_value, mysqlnd_num_fields(result) * 2); if (FAIL == result->m.fetch_row(result, (void *)return_value, flags, &fetched_anything TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading a row"); + zval_dtor(return_value); RETVAL_FALSE; } else if (fetched_anything == FALSE) { zval_dtor(return_value); diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index 00566b1b6..c51d216f3 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -831,7 +831,7 @@ Fixed bug #36820 (Privileged connection with an Oracle password file fails) <date>2006-03-16</date> <license uri="http://www.php.net/license">PHP</license> <notes>Changed OCI8 code to use OCIServerVersion() instead of OCIPing(), which may crash Oracle server of version < 10.2 -Fixed bug #36235 (ocicolumnname returns false before a succesfull fetch) +Fixed bug #36235 (ocicolumnname returns false before a successfull fetch) Fixed bug #36096 (oci_result() returns garbage after oci_fetch() failed) Fixed bug #36055 (possible OCI8 crash in multithreaded environment) Fixed bug #36010 (Segfault when re-creating and re-executing statements with bound parameters) diff --git a/ext/oci8/tests/bug43492_2.phpt b/ext/oci8/tests/bug43492_2.phpt index 61511cf6d..d735f6429 100644 --- a/ext/oci8/tests/bug43492_2.phpt +++ b/ext/oci8/tests/bug43492_2.phpt @@ -8,7 +8,7 @@ require(dirname(__FILE__).'/skipif.inc'); --FILE-- <?php -// This test is similar to bug43492.phpt without the explict free. +// This test is similar to bug43492.phpt without the explicit free. // Now that bug 44206 is fixed an automatic clean up will occur - // though it is still recommended in practice. diff --git a/ext/oci8/tests/conn_attr.inc b/ext/oci8/tests/conn_attr.inc index 2c086b189..220e68821 100644 --- a/ext/oci8/tests/conn_attr.inc +++ b/ext/oci8/tests/conn_attr.inc @@ -98,7 +98,7 @@ function set_attr($conn,$attr,$sufix) else if (!strcmp($attr,'CLIENT_IDENTIFIER')) $r = oci_set_client_identifier($conn,'ID00'.$sufix); else - echo "Pass one of the above four attibutes!!!\n"; + echo "Pass one of the above four attributes!!!\n"; if ($r) { echo "Value of $attr has been set successfully\n"; } diff --git a/ext/oci8/tests/conn_attr_4.phpt b/ext/oci8/tests/conn_attr_4.phpt index d15b7a38d..4885f80b7 100644 --- a/ext/oci8/tests/conn_attr_4.phpt +++ b/ext/oci8/tests/conn_attr_4.phpt @@ -62,7 +62,7 @@ foreach($values_array as $val ) { oci_set_client_info($c1,$val); $r = oci_set_action($c1,$val); if ($r) { - echo "Values set succesfully to $val\n"; + echo "Values set successfully to $val\n"; foreach($attr_array as $attr) { get_attr($c1,$attr); } @@ -98,12 +98,12 @@ bool(true) The value of ACTION is ACTION1 Setting to different values -Values set succesfully to 1000 +Values set successfully to 1000 The value of MODULE is 1000 The value of ACTION is 1000 The value of CLIENT_INFO is 1000 The value of CLIENT_IDENTIFIER is 1000 -Values set succesfully to +Values set successfully to The value of MODULE is The value of ACTION is The value of CLIENT_INFO is diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4 index 5be3288f3..a1201db57 100644 --- a/ext/odbc/config.m4 +++ b/ext/odbc/config.m4 @@ -370,18 +370,33 @@ PHP_ARG_WITH(iodbc,, if test "$PHP_IODBC" != "no"; then AC_MSG_CHECKING(for iODBC support) - if test "$PHP_IODBC" = "yes"; then - PHP_IODBC=/usr/local + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libiodbc ; then + PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR) + ODBC_TYPE=iodbc + ODBC_INCLUDE=`$PKG_CONFIG --cflags-only-I libiodbc` + ODBC_LFLAGS=`$PKG_CONFIG --libs-only-L libiodbc` + ODBC_LIBS=`$PKG_CONFIG --libs-only-l libiodbc` + PHP_EVAL_INCLINE($ODBC_INCLUDE) + AC_DEFINE(HAVE_IODBC,1,[ ]) + AC_DEFINE(HAVE_ODBC2,1,[ ]) + AC_MSG_RESULT([$ext_output]) + else + if test "$PHP_IODBC" = "yes"; then + PHP_IODBC=/usr/local + fi + PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR) + PHP_ADD_INCLUDE($PHP_IODBC/include, 1) + ODBC_TYPE=iodbc + ODBC_INCLUDE=-I$PHP_IODBC/include + ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR + ODBC_LIBS=-liodbc + AC_DEFINE(HAVE_IODBC,1,[ ]) + AC_DEFINE(HAVE_ODBC2,1,[ ]) + AC_MSG_RESULT([$ext_output]) fi - PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR) - PHP_ADD_INCLUDE($PHP_IODBC/include, 1) - ODBC_TYPE=iodbc - ODBC_INCLUDE=-I$PHP_IODBC/include - ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR - ODBC_LIBS=-liodbc - AC_DEFINE(HAVE_IODBC,1,[ ]) - AC_DEFINE(HAVE_ODBC2,1,[ ]) - AC_MSG_RESULT([$ext_output]) fi fi diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index adb7272d4..c84a4ecc6 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1765,7 +1765,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) if (result_type & ODBC_NUM) { zend_hash_index_update(Z_ARRVAL_P(return_value), i, &tmp, sizeof(zval *), NULL); } else { - if (!*(result->values[i].name)) { + if (!*(result->values[i].name) && Z_TYPE_P(tmp) == IS_STRING) { zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)+1, &tmp, sizeof(zval *), NULL); } else { zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].name)+1, &tmp, sizeof(zval *), NULL); @@ -2704,7 +2704,7 @@ PHP_FUNCTION(odbc_num_rows) #if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) /* {{{ proto bool odbc_next_result(resource result_id) - Checks if multiple results are avaiable */ + Checks if multiple results are available */ PHP_FUNCTION(odbc_next_result) { odbc_result *result; diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h index 8251528e1..ca237c053 100644 --- a/ext/odbc/php_odbc_includes.h +++ b/ext/odbc/php_odbc_includes.h @@ -161,7 +161,7 @@ PHP_FUNCTION(solid_fetch_prev); #define UNIX /* * Extended Fetch in the Birdstep ODBC API is incapable of returning long varchar (memo) fields. - * So the following line has been commented-out to accomadate. - KNS + * So the following line has been commented-out to accommodate. - KNS * * #define HAVE_SQL_EXTENDED_FETCH 1 */ diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index d7ac117e5..f1dfa5024 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -561,6 +561,7 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname TSRMLS_DC) /* {{{ */ { + zval **data; zval *subitem, *subentries; int i, j = -1, last = -1, obj_cnt = 0; char *sname; @@ -578,7 +579,7 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s for (i = 0; i < X509_NAME_entry_count(name); i++) { unsigned char *to_add; - int to_add_len; + int to_add_len = 0; ne = X509_NAME_get_entry(name, i); @@ -592,39 +593,27 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s sname = (char *) OBJ_nid2ln(nid); } - MAKE_STD_ZVAL(subentries); - array_init(subentries); + str = X509_NAME_ENTRY_get_data(ne); + if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) { + to_add_len = ASN1_STRING_to_UTF8(&to_add, str); + } else { + to_add = ASN1_STRING_data(str); + to_add_len = ASN1_STRING_length(str); + } - last = -1; - for (;;) { - j = X509_NAME_get_index_by_OBJ(name, obj, last); - if (j < 0) { - if (last != -1) break; - } else { - obj_cnt++; - ne = X509_NAME_get_entry(name, j); - str = X509_NAME_ENTRY_get_data(ne); - if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) { - to_add_len = ASN1_STRING_to_UTF8(&to_add, str); - if (to_add_len != -1) { - add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1); - } - } else { - to_add = ASN1_STRING_data(str); - to_add_len = ASN1_STRING_length(str); + if (to_add_len != -1) { + if (zend_hash_find(Z_ARRVAL_P(subitem), sname, strlen(sname)+1, (void**)&data) == SUCCESS) { + if (Z_TYPE_PP(data) == IS_ARRAY) { + subentries = *data; + add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1); + } else if (Z_TYPE_PP(data) == IS_STRING) { + MAKE_STD_ZVAL(subentries); + array_init(subentries); + add_next_index_stringl(subentries, Z_STRVAL_PP(data), Z_STRLEN_PP(data), 1); add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1); + zend_hash_update(Z_ARRVAL_P(subitem), sname, strlen(sname)+1, &subentries, sizeof(zval*), NULL); } - } - last = j; - } - i = last; - - if (obj_cnt > 1) { - add_assoc_zval_ex(subitem, sname, strlen(sname) + 1, subentries); - } else { - zval_dtor(subentries); - FREE_ZVAL(subentries); - if (obj_cnt && str && to_add_len > -1) { + } else { add_assoc_stringl(subitem, sname, (char *)to_add, to_add_len, 1); } } @@ -1398,6 +1387,74 @@ PHP_FUNCTION(openssl_x509_check_private_key) } /* }}} */ +/* Special handling of subjectAltName, see CVE-2013-4073 + * Christian Heimes + */ + +static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension) +{ + GENERAL_NAMES *names; + const X509V3_EXT_METHOD *method = NULL; + long i, length, num; + const unsigned char *p; + + method = X509V3_EXT_get(extension); + if (method == NULL) { + return -1; + } + + p = extension->value->data; + length = extension->value->length; + if (method->it) { + names = (GENERAL_NAMES*)(ASN1_item_d2i(NULL, &p, length, + ASN1_ITEM_ptr(method->it))); + } else { + names = (GENERAL_NAMES*)(method->d2i(NULL, &p, length)); + } + if (names == NULL) { + return -1; + } + + num = sk_GENERAL_NAME_num(names); + for (i = 0; i < num; i++) { + GENERAL_NAME *name; + ASN1_STRING *as; + name = sk_GENERAL_NAME_value(names, i); + switch (name->type) { + case GEN_EMAIL: + BIO_puts(bio, "email:"); + as = name->d.rfc822Name; + BIO_write(bio, ASN1_STRING_data(as), + ASN1_STRING_length(as)); + break; + case GEN_DNS: + BIO_puts(bio, "DNS:"); + as = name->d.dNSName; + BIO_write(bio, ASN1_STRING_data(as), + ASN1_STRING_length(as)); + break; + case GEN_URI: + BIO_puts(bio, "URI:"); + as = name->d.uniformResourceIdentifier; + BIO_write(bio, ASN1_STRING_data(as), + ASN1_STRING_length(as)); + break; + default: + /* use builtin print for GEN_OTHERNAME, GEN_X400, + * GEN_EDIPARTY, GEN_DIRNAME, GEN_IPADD and GEN_RID + */ + GENERAL_NAME_print(bio, name); + } + /* trailing ', ' except for last element */ + if (i < (num - 1)) { + BIO_puts(bio, ", "); + } + } + sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); + + return 0; +} + /* {{{ proto array openssl_x509_parse(mixed x509 [, bool shortnames=true]) Returns an array of the fields/values of the CERT */ PHP_FUNCTION(openssl_x509_parse) @@ -1494,15 +1551,30 @@ PHP_FUNCTION(openssl_x509_parse) for (i = 0; i < X509_get_ext_count(cert); i++) { + int nid; extension = X509_get_ext(cert, i); - if (OBJ_obj2nid(X509_EXTENSION_get_object(extension)) != NID_undef) { + nid = OBJ_obj2nid(X509_EXTENSION_get_object(extension)); + if (nid != NID_undef) { extname = (char *)OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(extension))); } else { OBJ_obj2txt(buf, sizeof(buf)-1, X509_EXTENSION_get_object(extension), 1); extname = buf; } bio_out = BIO_new(BIO_s_mem()); - if (X509V3_EXT_print(bio_out, extension, 0, 0)) { + if (nid == NID_subject_alt_name) { + if (openssl_x509v3_subjectAltName(bio_out, extension) == 0) { + BIO_get_mem_ptr(bio_out, &bio_buf); + add_assoc_stringl(subitem, extname, bio_buf->data, bio_buf->length, 1); + } else { + zval_dtor(return_value); + if (certresource == -1 && cert) { + X509_free(cert); + } + BIO_free(bio_out); + RETURN_FALSE; + } + } + else if (X509V3_EXT_print(bio_out, extension, 0, 0)) { BIO_get_mem_ptr(bio_out, &bio_buf); add_assoc_stringl(subitem, extname, bio_buf->data, bio_buf->length, 1); } else { diff --git a/ext/openssl/tests/bug64802.pem b/ext/openssl/tests/bug64802.pem new file mode 100644 index 000000000..187cda31d --- /dev/null +++ b/ext/openssl/tests/bug64802.pem @@ -0,0 +1,37 @@ +-----BEGIN CERTIFICATE----- +MIIGfzCCBWegAwIBAgIQSVCinGH6MkvjJZjRyjK9nTANBgkqhkiG9w0BAQUFADCB +jjELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxNDAyBgNV +BAMTK0NPTU9ETyBFeHRlbmRlZCBWYWxpZGF0aW9uIFNlY3VyZSBTZXJ2ZXIgQ0Ew +HhcNMTIwMjI5MDAwMDAwWhcNMTQwMjI4MjM1OTU5WjCCAW8xEjAQBgNVBAMTCXd3 +dy5yZC5pbzERMA8GA1UEAxMIcmRpby5jb20xDjAMBgNVBAMTBXJkLmlvMRUwEwYD +VQQDEwxhcGkucmRpby5jb20xEjAQBgNVBAMTCWFwaS5yZC5pbzEQMA4GA1UEBRMH +NDU4NjAwNzETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgECEwhE +ZWxhd2FyZTEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xCzAJBgNVBAYT +AlVTMQ4wDAYDVQQREwU5NDEwMzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDVNhbiBG +cmFuY2lzY28xFzAVBgNVBAkTDjE1NTAgQnJ5YW50IHN0MRMwEQYDVQQKEwpSZGlv +LCBJbmMuMSMwIQYDVQQLExpDT01PRE8gRVYgTXVsdGktRG9tYWluIFNTTDEVMBMG +A1UEAxMMd3d3LnJkaW8uY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAt0AgYOe8EBJNVBAuSJFLKHRKZn0/ObCLBFG4xVH/5fb1rfYHBT1XSjjOqR3t +iGC/A3esF8YC7TuHQcTLVephx0DtJv1ASxRg3zPM8ebBRsuul18N0W+sY1aNXpkd +36quxvjg5UdBrAweuekJ7OTSZcCe2Ry/SKBeZSWWtkWsI4krCLv7JaKUwxw2h+Hn +TAZSBLVxz/mixF0WYdepYwnq2Hm7XvvVEIQ7wxOQ9bA7iCevLojZOnb39BT2QII7 +cy8AB47RZdfYg7UwaO3bST2rauA4MKar7/Ozqc0aemNFpLatJfgv07cydiuj9fsd +5aE/c8is8C9M9+7MmSMkcNEgGwIDAQABo4IB8zCCAe8wHwYDVR0jBBgwFoAUiERR +/1AqaV4tiPQhutkM8s7L6nwwHQYDVR0OBBYEFCrYw8bfrYJ61NS2yYx6/CnhjzT4 +MA4GA1UdDwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUF +BwMBBggrBgEFBQcDAjBGBgNVHSAEPzA9MDsGDCsGAQQBsjEBAgEFATArMCkGCCsG +AQUFBwIBFh1odHRwczovL3NlY3VyZS5jb21vZG8uY29tL0NQUzBTBgNVHR8ETDBK +MEigRqBEhkJodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9FeHRlbmRlZFZh +bGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcmwwgYQGCCsGAQUFBwEBBHgwdjBOBggr +BgEFBQcwAoZCaHR0cDovL2NydC5jb21vZG9jYS5jb20vQ09NT0RPRXh0ZW5kZWRW +YWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCQGCCsGAQUFBzABhhhodHRwOi8v +b2NzcC5jb21vZG9jYS5jb20wTAYDVR0RBEUwQ4IMd3d3LnJkaW8uY29tgglhcGku +cmQuaW+CDGFwaS5yZGlvLmNvbYIFcmQuaW+CCHJkaW8uY29tggl3d3cucmQuaW8w +DQYJKoZIhvcNAQEFBQADggEBAKFd4bPVFRyrlqIKPtrtMuqGqid6685ohxf0cv52 +sjdRYwLVTjnZOrmkDdNaF3R2A1ZlVMRN+67rK+qfY5sTeijFcudV3/i0PDtOFRwP +6yYVD2uZmYkxfPiW309HPmDF+EzhxpVjWlTQEOwkfFLTmJmwl3Qu2Kffp8F1ENXW +OTVNvj5VtMghvzu68PpzKl1VjlOR4Ej9NCwh1dUjNKEoTPzvpehXsIZ7jHSpX/T1 +wSSt9ckiechDdpgZXTzHgbxHNibK0Uhh+QhkBgYMj5F8qj5BlBhWAWqQa/VnEdmr +Pfo7U+QmadoqQd7qt06hE2hG1nfZ0vPJDbWV3oVSwG2Yt7I= +-----END CERTIFICATE----- diff --git a/ext/openssl/tests/bug64802.phpt b/ext/openssl/tests/bug64802.phpt new file mode 100644 index 000000000..9a5970149 --- /dev/null +++ b/ext/openssl/tests/bug64802.phpt @@ -0,0 +1,56 @@ +--TEST-- +Bug #64802: openssl_x509_parse fails to parse subject properly in some cases +--SKIPIF-- +<?php +if (!extension_loaded("openssl")) die("skip"); +?> +--FILE-- +<?php +$cert = file_get_contents(__DIR__.'/bug64802.pem'); +$r = openssl_x509_parse($cert,$use_short_names=true); +sort($r['subject']); +var_dump( $r['subject'] ); +?> +--EXPECTF-- +array(11) { + [0]=> + string(14) "1550 Bryant st" + [1]=> + string(5) "94103" + [2]=> + string(7) "4586007" + [3]=> + string(2) "CA" + [4]=> + string(26) "COMODO EV Multi-Domain SSL" + [5]=> + string(20) "Private Organization" + [6]=> + string(10) "Rdio, Inc." + [7]=> + string(13) "San Francisco" + [8]=> + string(2) "US" + [9]=> + array(2) { + [0]=> + string(2) "US" + [1]=> + string(8) "Delaware" + } + [10]=> + array(6) { + [0]=> + string(9) "www.rd.io" + [1]=> + string(8) "rdio.com" + [2]=> + string(5) "rd.io" + [3]=> + string(12) "api.rdio.com" + [4]=> + string(9) "api.rd.io" + [5]=> + string(12) "www.rdio.com" + } +} diff --git a/ext/openssl/tests/cve2013_4073.pem b/ext/openssl/tests/cve2013_4073.pem new file mode 100644 index 000000000..7ebb99492 --- /dev/null +++ b/ext/openssl/tests/cve2013_4073.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx +DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ +eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg +RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y +ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw +NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI +DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv +ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt +ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq +hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j +pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P +vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv +KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA +oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL +08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV +HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E +BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu +Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251 +bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA +AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9 +i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j +HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk +kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx +VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW +RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ= +-----END CERTIFICATE----- diff --git a/ext/openssl/tests/cve2013_4073.phpt b/ext/openssl/tests/cve2013_4073.phpt new file mode 100644 index 000000000..e676ddfb9 --- /dev/null +++ b/ext/openssl/tests/cve2013_4073.phpt @@ -0,0 +1,19 @@ +--TEST-- +CVE 2013-4073: Null-byte certificate handling +--SKIPIF-- +<?php +if (!extension_loaded("openssl")) die("skip"); +--FILE-- +<?php +$cert = file_get_contents(__DIR__ . '/cve2013_4073.pem'); +$info = openssl_x509_parse($cert); +var_export($info['extensions']); + +--EXPECTF-- +array ( + 'basicConstraints' => 'CA:FALSE', + 'subjectKeyIdentifier' => '88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C', + 'keyUsage' => 'Digital Signature, Non Repudiation, Key Encipherment', + 'subjectAltName' => 'DNS:altnull.python.org' . "\0" . 'example.com, email:null@python.org' . "\0" . 'user@example.org, URI:http://null.python.org' . "\0" . 'http://example.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1 +', +) diff --git a/ext/openssl/tests/openssl.cnf b/ext/openssl/tests/openssl.cnf index 10e69076c..4ed40fdc8 100644 --- a/ext/openssl/tests/openssl.cnf +++ b/ext/openssl/tests/openssl.cnf @@ -3,7 +3,7 @@ default_bits = 1024 default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes -x509_extensions = v3_ca # The extentions to add to the self signed cert +x509_extensions = v3_ca # The extensions to add to the self signed cert string_mask = MASK:4294967295 diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 0e1523853..6e74d8024 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -274,7 +274,7 @@ static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_ * Essentially, we are waiting for the socket to become writeable, which means * that all pending data has been sent. * We use a small timeout which should encourage the OS to send the data, - * but at the same time avoid hanging indefintely. + * but at the same time avoid hanging indefinitely. * */ do { n = php_pollfd_for_ms(sslsock->s.socket, POLLOUT, 500); @@ -472,7 +472,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream, do { struct timeval cur_time, - elapsed_time; + elapsed_time = {0}; if (sslsock->is_client) { n = SSL_connect(sslsock->ssl_handle); diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c index 7e123a1ac..b3cccac44 100644 --- a/ext/pcntl/php_signal.c +++ b/ext/pcntl/php_signal.c @@ -23,7 +23,7 @@ #include "Zend/zend.h" #include "Zend/zend_signal.h" -/* php_signal using sigaction is derrived from Advanced Programing +/* php_signal using sigaction is derived from Advanced Programing * in the Unix Environment by W. Richard Stevens p 298. */ Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all) { diff --git a/ext/pcntl/tests/pcntl_exec.phpt b/ext/pcntl/tests/pcntl_exec.phpt index 9d2ec1dcf..9a2c96ea3 100644 --- a/ext/pcntl/tests/pcntl_exec.phpt +++ b/ext/pcntl/tests/pcntl_exec.phpt @@ -8,7 +8,7 @@ if (!getenv("TEST_PHP_EXECUTABLE") || !is_executable(getenv("TEST_PHP_EXECUTABLE --FILE-- <?php echo "ok\n"; -pcntl_exec(getenv("TEST_PHP_EXECUTABLE")); +pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), ['-n']); echo "nok\n"; ?> --EXPECT-- diff --git a/ext/pcntl/tests/pcntl_exec_2.phpt b/ext/pcntl/tests/pcntl_exec_2.phpt index 02b5e22aa..e18527dba 100644 --- a/ext/pcntl/tests/pcntl_exec_2.phpt +++ b/ext/pcntl/tests/pcntl_exec_2.phpt @@ -14,7 +14,7 @@ if (getenv("PCNTL_EXEC_TEST_IS_CHILD")) { exit; } echo "ok\n"; -pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), array(__FILE__), array( +pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), array('-n', __FILE__), array( b"PCNTL_EXEC_TEST_IS_CHILD" => b"1", b"FOO" => b"BAR", 1 => b"long") diff --git a/ext/pcre/pcrelib/ChangeLog b/ext/pcre/pcrelib/ChangeLog index 1b016ecee..ed164fed0 100644 --- a/ext/pcre/pcrelib/ChangeLog +++ b/ext/pcre/pcrelib/ChangeLog @@ -1751,7 +1751,7 @@ Version 7.7 07-May-08 containing () gave an internal compiling error instead of "reference to non-existent subpattern". Fortunately, when the pattern did exist, the compiled code was correct. (When scanning forwards to check for the - existencd of the subpattern, it was treating the data ']' as terminating + existence of the subpattern, it was treating the data ']' as terminating the class, so got the count wrong. When actually compiling, the reference was subsequently set up correctly.) diff --git a/ext/pcre/pcrelib/NEWS b/ext/pcre/pcrelib/NEWS index ebd9c5ec9..082139f22 100644 --- a/ext/pcre/pcrelib/NEWS +++ b/ext/pcre/pcrelib/NEWS @@ -591,7 +591,7 @@ some of the new functionality in Perl 5.005. Another (I hope this is the last!) change has been made to the API for the pcre_compile() function. An additional argument has been added to make it possible to pass over a pointer to character tables built in the current -locale by pcre_maketables(). To use the default tables, this new arguement +locale by pcre_maketables(). To use the default tables, this new argument should be passed as NULL. IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.05 diff --git a/ext/pcre/pcrelib/pcre_compile.c b/ext/pcre/pcrelib/pcre_compile.c index 5f0c8ed08..4997b3b1e 100644 --- a/ext/pcre/pcrelib/pcre_compile.c +++ b/ext/pcre/pcrelib/pcre_compile.c @@ -8139,7 +8139,7 @@ if (code - codestart > length) errorcode = ERR23; #ifdef SUPPORT_VALGRIND /* If the estimated length exceeds the really used length, mark the extra -allocated memory as unadressable, so that any out-of-bound reads can be +allocated memory as unaddressable, so that any out-of-bound reads can be detected. */ VALGRIND_MAKE_MEM_NOACCESS(code, (length - (code - codestart)) * sizeof(pcre_uchar)); #endif diff --git a/ext/pcre/tests/preg_grep_error1.phpt b/ext/pcre/tests/preg_grep_error1.phpt index 29dfc5af1..ae2eb128b 100644 --- a/ext/pcre/tests/preg_grep_error1.phpt +++ b/ext/pcre/tests/preg_grep_error1.phpt @@ -11,9 +11,9 @@ error_reporting(E_ALL&~E_NOTICE); * Testing how preg_grep reacts to being passed bad regexes */ echo "*** Testing preg_grep() : error conditions ***\n"; -$values = array('abcdef', //Regex without delimeter -'/[a-zA-Z]', //Regex without closing delimeter -'[a-zA-Z]/', //Regex without opening delimeter +$values = array('abcdef', //Regex without delimiter +'/[a-zA-Z]', //Regex without closing delimiter +'[a-zA-Z]/', //Regex without opening delimiter '/[a-zA-Z]/F', array('[a-z]', //Array of Regexes '[A-Z]', '[0-9]'), '/[a-zA-Z]/', //Regex string ); diff --git a/ext/pcre/tests/preg_match_all_error1.phpt b/ext/pcre/tests/preg_match_all_error1.phpt index a3cb68404..95ab905d7 100644 --- a/ext/pcre/tests/preg_match_all_error1.phpt +++ b/ext/pcre/tests/preg_match_all_error1.phpt @@ -11,9 +11,9 @@ error_reporting(E_ALL&~E_NOTICE); * Testing how preg_match_all reacts to being passed the wrong type of regex argument */ echo "*** Testing preg_match_all() : error conditions ***\n"; -$regex_array = array('abcdef', //Regex without delimeter -'/[a-zA-Z]', //Regex without closing delimeter -'[a-zA-Z]/', //Regex without opening delimeter +$regex_array = array('abcdef', //Regex without delimiter +'/[a-zA-Z]', //Regex without closing delimiter +'[a-zA-Z]/', //Regex without opening delimiter '/[a-zA-Z]/F', array('[a-z]', //Array of Regexes '[A-Z]', '[0-9]'), '/[a-zA-Z]/', //Regex string ); diff --git a/ext/pcre/tests/preg_match_error1.phpt b/ext/pcre/tests/preg_match_error1.phpt index 763048151..ec9cf8cec 100644 --- a/ext/pcre/tests/preg_match_error1.phpt +++ b/ext/pcre/tests/preg_match_error1.phpt @@ -11,9 +11,9 @@ error_reporting(E_ALL&~E_NOTICE); * Testing how preg_match reacts to being passed the wrong type of regex argument */ echo "*** Testing preg_match() : error conditions ***\n"; -$regex_array = array('abcdef', //Regex without delimeter -'/[a-zA-Z]', //Regex without closing delimeter -'[a-zA-Z]/', //Regex without opening delimeter +$regex_array = array('abcdef', //Regex without delimiter +'/[a-zA-Z]', //Regex without closing delimiter +'[a-zA-Z]/', //Regex without opening delimiter '/[a-zA-Z]/F', array('[a-z]', //Array of Regexes '[A-Z]', '[0-9]'), '/[a-zA-Z]/', //Regex string ); diff --git a/ext/pcre/tests/preg_replace_basic.phpt b/ext/pcre/tests/preg_replace_basic.phpt index 33fb2d4a8..6962bce25 100644 --- a/ext/pcre/tests/preg_replace_basic.phpt +++ b/ext/pcre/tests/preg_replace_basic.phpt @@ -11,7 +11,7 @@ var_dump($string); var_dump(preg_replace('<- This is a string$>', 'This shouldn\'t work', $string)); //tries to find '- This is a string' at the end of a string but can't so replaces nothing and prints the unchanged $string. var_dump(preg_replace('<[0-35-9]>', '4', $string)); //finds any number that's not 4 and replaces it with a 4 ('444444444') var_dump(preg_replace('<\b[hH]\w{2,4}>', 'Bonjour', $string)); //finds h or H at the beginning of a word followed by 2-4 characters and replaces it with Bonjour (i.e. Hello -> Bonjour) (was finding the 'his' in This and replacing it) -var_dump(preg_replace('<(\w)\s*-\s*(\w)>', '\\1. \\2', $string)); //finds dashes with an indefinate amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space +var_dump(preg_replace('<(\w)\s*-\s*(\w)>', '\\1. \\2', $string)); //finds dashes with an indefinite amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>', '\\1 at \\2 dot \\3 dot \\4', 'josmessa@uk.ibm.com')); //finds the e-mail address and replaces the @ and . with "at" and "dot" (uses backreferences) ('josmessa at uk dot ibm dot com') ?> diff --git a/ext/pcre/tests/preg_replace_edit_basic.phpt b/ext/pcre/tests/preg_replace_edit_basic.phpt index 97350e756..556b48b8c 100644 --- a/ext/pcre/tests/preg_replace_edit_basic.phpt +++ b/ext/pcre/tests/preg_replace_edit_basic.phpt @@ -24,7 +24,7 @@ var_dump(preg_replace('<\b[hH]\w{2,4}>', 'Bonjour', $string)); //finds h or H at the beginning of a word followed by 2-4 characters and replaces it with Bonjour (i.e. Hello -> Bonjour) (was finding the 'his' in This and replacing it) var_dump(preg_replace('<(\w)\s*-\s*(\w)>', - '\\1. \\2', $string)); //finds dashes with an indefinate amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space + '\\1. \\2', $string)); //finds dashes with an indefinite amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>', '\\1 at \\2 dot \\3 dot \\4', 'josmessa@uk.ibm.com')); //finds the e-mail address and replaces the @ and . with "at" and "dot" (uses backreferences) ('josmessa at uk dot ibm dot com') diff --git a/ext/pcre/tests/preg_replace_error1.phpt b/ext/pcre/tests/preg_replace_error1.phpt index 7ddfcfdef..ec573c77b 100644 --- a/ext/pcre/tests/preg_replace_error1.phpt +++ b/ext/pcre/tests/preg_replace_error1.phpt @@ -11,9 +11,9 @@ error_reporting(E_ALL&~E_NOTICE); * Testing how preg_replace reacts to being passed the wrong type of regex argument */ echo "*** Testing preg_replace() : error conditions***\n"; -$regex_array = array('abcdef', //Regex without delimeter -'/[a-zA-Z]', //Regex without closing delimeter -'[a-zA-Z]/', //Regex without opening delimeter +$regex_array = array('abcdef', //Regex without delimiter +'/[a-zA-Z]', //Regex without closing delimiter +'[a-zA-Z]/', //Regex without opening delimiter '/[a-zA-Z]/F', array('[a-z]', //Array of Regexes '[A-Z]', '[0-9]'), '/[a-zA-Z]/', //Regex string ); diff --git a/ext/pcre/tests/preg_split_basic.phpt b/ext/pcre/tests/preg_split_basic.phpt index e94a94f62..5d23ce6df 100644 --- a/ext/pcre/tests/preg_split_basic.phpt +++ b/ext/pcre/tests/preg_split_basic.phpt @@ -7,7 +7,7 @@ Test preg_split() function : basic functionality * Function is implemented in ext/pcre/php_pcre.c */ $string = 'this is a_list: value1, Test__, string; Hello, world!_(parentheses)'; -var_dump(preg_split('/[:,;\(\)]/', $string, -1, PREG_SPLIT_NO_EMPTY)); //parts of $string seperated by : , ; ( or ) are put into an array. +var_dump(preg_split('/[:,;\(\)]/', $string, -1, PREG_SPLIT_NO_EMPTY)); //parts of $string separated by : , ; ( or ) are put into an array. var_dump(preg_split('/:\s*(\w*,*\s*)+;/', $string)); //all text between : and ; is removed var_dump(preg_split('/(\(|\))/', $string, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY)); //all text before (parentheses) is put into first element, ( into second, "parentheses" into third and ) into fourth. var_dump(preg_split('/NAME/i', $string)); //tries to find NAME regardless of case in $string (can't split it so just returns how string as first element) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index e6265f580..d5860b1a1 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -338,6 +338,9 @@ static PHP_METHOD(PDO, dbh_constructor) if (pdbh->std.properties) { zend_hash_destroy(dbh->std.properties); efree(dbh->std.properties); + if (dbh->std.properties_table) { + efree(dbh->std.properties_table); + } } else { pdbh->std.ce = dbh->std.ce; pdbh->def_stmt_ce = dbh->def_stmt_ce; @@ -896,7 +899,7 @@ static PHP_METHOD(PDO, getAttribute) PDO_DBH_CLEAR_ERR(); PDO_CONSTRUCT_CHECK; - /* handle generic PDO-level atributes */ + /* handle generic PDO-level attributes */ switch (attr) { case PDO_ATTR_PERSISTENT: RETURN_BOOL(dbh->is_persistent); @@ -994,7 +997,7 @@ static PHP_METHOD(PDO, lastInsertId) pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support lastInsertId()" TSRMLS_CC); RETURN_FALSE; } else { - Z_STRVAL_P(return_value) = dbh->methods->last_id(dbh, name, &Z_STRLEN_P(return_value) TSRMLS_CC); + Z_STRVAL_P(return_value) = dbh->methods->last_id(dbh, name, (unsigned int *)&Z_STRLEN_P(return_value) TSRMLS_CC); if (!Z_STRVAL_P(return_value)) { PDO_HANDLE_DBH_ERR(); RETURN_FALSE; @@ -1575,6 +1578,7 @@ static void pdo_dbh_free_storage(pdo_dbh_t *dbh TSRMLS_DC) } zend_object_std_dtor(&dbh->std TSRMLS_CC); dbh->std.properties = NULL; + dbh->std.properties_table = NULL; dbh_free(dbh TSRMLS_CC); } diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c index 6aee27545..fcaa4e492 100644 --- a/ext/pdo/pdo_sql_parser.c +++ b/ext/pdo/pdo_sql_parser.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Thu Apr 19 12:42:11 2012 */ +/* Generated by re2c 0.13.5 on Tue Aug 20 18:02:48 2013 */ /* +----------------------------------------------------------------------+ | PHP Version 5 | @@ -74,14 +74,14 @@ yy2: yy3: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych >= 0x01) goto yy41; + if (yych >= 0x01) goto yy43; yy4: { SKIP_ONE(PDO_PARSER_TEXT); } yy5: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 0x00) goto yy4; - goto yy36; + goto yy38; yy6: yych = *++YYCURSOR; switch (yych) { @@ -148,14 +148,12 @@ yy6: case 'x': case 'y': case 'z': goto yy32; - case ':': - case '?': goto yy29; + case ':': goto yy35; default: goto yy4; } yy7: ++YYCURSOR; switch ((yych = *YYCURSOR)) { - case ':': case '?': goto yy29; default: goto yy8; } @@ -277,7 +275,6 @@ yy29: if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; switch (yych) { - case ':': case '?': goto yy29; default: goto yy31; } @@ -359,40 +356,48 @@ yy35: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy36: switch (yych) { - case 0x00: goto yy2; - case '\'': goto yy38; - case '\\': goto yy37; - default: goto yy35; + case ':': goto yy35; + default: goto yy31; } yy37: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x00) goto yy2; - goto yy35; yy38: + switch (yych) { + case 0x00: goto yy2; + case '\'': goto yy40; + case '\\': goto yy39; + default: goto yy37; + } +yy39: ++YYCURSOR; - { RET(PDO_PARSER_TEXT); } + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= 0x00) goto yy2; + goto yy37; yy40: ++YYCURSOR; + { RET(PDO_PARSER_TEXT); } +yy42: + ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy41: +yy43: switch (yych) { case 0x00: goto yy2; - case '"': goto yy43; - case '\\': goto yy42; - default: goto yy40; + case '"': goto yy45; + case '\\': goto yy44; + default: goto yy42; } -yy42: +yy44: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= 0x00) goto yy2; - goto yy40; -yy43: + goto yy42; +yy45: ++YYCURSOR; { RET(PDO_PARSER_TEXT); } } @@ -741,9 +746,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char while (SUCCESS == zend_hash_get_current_data(params, (void**)¶m)) { if(param->parameter) { convert_to_string(param->parameter); - /* accomodate a string that needs to be fully quoted + /* accommodate a string that needs to be fully quoted bind placeholders are at least 2 characters, so - the accomodate their own "'s + the accommodate their own "'s */ newbuffer_len += padding * Z_STRLEN_P(param->parameter); } diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re index d4272d679..1936a3734 100644 --- a/ext/pdo/pdo_sql_parser.re +++ b/ext/pdo/pdo_sql_parser.re @@ -50,14 +50,14 @@ static int scan(Scanner *s) QUESTION = [?]; COMMENTS = ("/*"([^*]+|[*]+[^/*])*[*]*"*/"|"--"[^\r\n]*); SPECIALS = [:?"']; - MULTICHAR = [:?]; + MULTICHAR = ([:]{2,}|[?]{2,}); ANYNOEOF = [\001-\377]; */ /*!re2c (["](([\\]ANYNOEOF)|ANYNOEOF\["\\])*["]) { RET(PDO_PARSER_TEXT); } (['](([\\]ANYNOEOF)|ANYNOEOF\['\\])*[']) { RET(PDO_PARSER_TEXT); } - MULTICHAR{2,} { RET(PDO_PARSER_TEXT); } + MULTICHAR { RET(PDO_PARSER_TEXT); } BINDCHR { RET(PDO_PARSER_BIND); } QUESTION { RET(PDO_PARSER_BIND_POS); } SPECIALS { SKIP_ONE(PDO_PARSER_TEXT); } @@ -408,9 +408,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char while (SUCCESS == zend_hash_get_current_data(params, (void**)¶m)) { if(param->parameter) { convert_to_string(param->parameter); - /* accomodate a string that needs to be fully quoted + /* accommodate a string that needs to be fully quoted bind placeholders are at least 2 characters, so - the accomodate their own "'s + the accommodate their own "'s */ newbuffer_len += padding * Z_STRLEN_P(param->parameter); } diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index a469d09fc..9622cb3cc 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1146,7 +1146,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, zval_ptr_dtor(&val); pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC); return 0; - } else if (ce->unserialize(&return_value, ce, Z_TYPE_P(val) == IS_STRING ? Z_STRVAL_P(val) : "", Z_TYPE_P(val) == IS_STRING ? Z_STRLEN_P(val) : 0, NULL TSRMLS_CC) == FAILURE) { + } else if (ce->unserialize(&return_value, ce, (unsigned char *)(Z_TYPE_P(val) == IS_STRING ? Z_STRVAL_P(val) : ""), Z_TYPE_P(val) == IS_STRING ? Z_STRLEN_P(val) : 0, NULL TSRMLS_CC) == FAILURE) { zval_ptr_dtor(&val); pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC); zval_dtor(return_value); @@ -1876,7 +1876,7 @@ static PHP_METHOD(PDOStatement, getColumnMeta) int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip) { long mode = PDO_FETCH_BOTH; - int flags, argc = ZEND_NUM_ARGS() - skip; + int flags = 0, argc = ZEND_NUM_ARGS() - skip; zval ***args; zend_class_entry **cep; int retval; diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index f38e7b5ec..ede2d6fb7 100644 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -72,11 +72,11 @@ enum pdo_param_type { /* get_col ptr should point to a zval* and the driver is responsible for adding correct type information to get_column_meta() */ - PDO_PARAM_ZVAL -}; + PDO_PARAM_ZVAL, -/* magic flag to denote a parameter as being input/output */ -#define PDO_PARAM_INPUT_OUTPUT 0x80000000 + /* magic flag to denote a parameter as being input/output */ + PDO_PARAM_INPUT_OUTPUT = 0x80000000 +}; #define PDO_PARAM_FLAGS 0xFFFF0000 @@ -469,7 +469,7 @@ struct _pdo_dbh_t { /* when set, convert int/floats to strings */ unsigned stringify:1; - /* the sum of the number of bits here and the bit fields preceeding should + /* the sum of the number of bits here and the bit fields preceding should * equal 32 */ unsigned _reserved_flags:21; diff --git a/ext/pdo/tests/bug61292.phpt b/ext/pdo/tests/bug61292.phpt index 2381fd1a2..05b2e9c01 100644 --- a/ext/pdo/tests/bug61292.phpt +++ b/ext/pdo/tests/bug61292.phpt @@ -17,8 +17,15 @@ class Database_SQL extends PDO { function __construct() { + $dsn = getenv('PDOTEST_DSN'); + $user = getenv('PDOTEST_USER'); + $pass = getenv('PDOTEST_PASS'); + + if ($user === false) $user = NULL; + if ($pass === false) $pass = NULL; $options = array(PDO::ATTR_PERSISTENT => TRUE); - parent::__construct(getenv("PDOTEST_DSN"), getenv("PDOTEST_USER"), getenv("PDOTEST_PASS"), $options); + + parent::__construct($dsn, $user, $pass, $options); } var $bar = array(); diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index ffc910177..2aaf3975d 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -32,6 +32,9 @@ #include "php_pdo_dblib_int.h" #include "zend_exceptions.h" +/* Cache of the server supported datatypes, initialized in handle_factory */ +zval* pdo_dblib_datatypes; + static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) { pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; @@ -262,17 +265,41 @@ static struct pdo_dbh_methods dblib_methods = { static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) { pdo_dblib_db_handle *H; - int i, ret = 0; + int i, nvars, nvers, ret = 0; + int *val; + + const pdo_dblib_keyval tdsver[] = { + {"4.2",DBVERSION_42} + ,{"4.6",DBVERSION_46} + ,{"5.0",DBVERSION_70} /* FIXME: This does not work with Sybase, but environ will */ + ,{"6.0",DBVERSION_70} + ,{"7.0",DBVERSION_70} +#ifdef DBVERSION_71 + ,{"7.1",DBVERSION_71} +#endif +#ifdef DBVERSION_72 + ,{"7.2",DBVERSION_72} + ,{"8.0",DBVERSION_72} +#endif + ,{"10.0",DBVERSION_100} + ,{"auto",0} /* Only works with FreeTDS. Other drivers will bork */ + + }; + + nvers = sizeof(tdsver)/sizeof(tdsver[0]); + struct pdo_data_src_parser vars[] = { - { "charset", NULL, 0 }, - { "appname", "PHP " PDO_DBLIB_FLAVOUR, 0 }, - { "host", "127.0.0.1", 0 }, - { "dbname", NULL, 0 }, - { "secure", NULL, 0 }, /* DBSETLSECURE */ - /* TODO: DBSETLVERSION ? */ + { "charset", NULL, 0 } + ,{ "appname", "PHP " PDO_DBLIB_FLAVOUR, 0 } + ,{ "host", "127.0.0.1", 0 } + ,{ "dbname", NULL, 0 } + ,{ "secure", NULL, 0 } /* DBSETLSECURE */ + ,{ "version", NULL, 0 } /* DBSETLVERSION */ }; - - php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 5); + + nvars = sizeof(vars)/sizeof(vars[0]); + + php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, nvars); H = pecalloc(1, sizeof(*H), dbh->is_persistent); H->login = dblogin(); @@ -282,11 +309,37 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ goto cleanup; } + DBERRHANDLE(H->login, (EHANDLEFUNC) error_handler); + DBMSGHANDLE(H->login, (MHANDLEFUNC) msg_handler); + + if(vars[5].optval) { + for(i=0;i<nvers;i++) { + if(strcmp(vars[5].optval,tdsver[i].key) == 0) { + if(FAIL==dbsetlversion(H->login, tdsver[i].value)) { + pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Failed to set version specified in connection string." TSRMLS_CC); + goto cleanup; + } + break; + } + } + + if (i==nvers) { + printf("Invalid version '%s'\n", vars[5].optval); + pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Invalid version specified in connection string." TSRMLS_CC); + goto cleanup; /* unknown version specified */ + } + } + if (dbh->username) { - DBSETLUSER(H->login, dbh->username); + if(FAIL == DBSETLUSER(H->login, dbh->username)) { + goto cleanup; + } } + if (dbh->password) { - DBSETLPWD(H->login, dbh->password); + if(FAIL == DBSETLPWD(H->login, dbh->password)) { + goto cleanup; + } } #if !PHP_DBLIB_IS_MSSQL @@ -297,36 +350,52 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ DBSETLAPP(H->login, vars[1].optval); -#if PHP_DBLIB_IS_MSSQL - dbprocerrhandle(H->login, (EHANDLEFUNC) error_handler); - dbprocmsghandle(H->login, (MHANDLEFUNC) msg_handler); +#ifdef DBSETLDBNAME + if (vars[3].optval) { + DBSETLDBNAME(H->login, vars[3].optval); + } #endif H->link = dbopen(H->login, vars[2].optval); - if (H->link == NULL) { + if (!H->link) { goto cleanup; } +#if PHP_DBLIB_IS_MSSQL /* dblib do not return more than this length from text/image */ DBSETOPT(H->link, DBTEXTLIMIT, "2147483647"); +#endif /* limit text/image from network */ DBSETOPT(H->link, DBTEXTSIZE, "2147483647"); /* allow double quoted indentifiers */ - DBSETOPT(H->link, DBQUOTEDIDENT, NULL); - - if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) { - goto cleanup; - } + DBSETOPT(H->link, DBQUOTEDIDENT, "1"); ret = 1; dbh->max_escaped_char_length = 2; dbh->alloc_own_columns = 1; +#if 0 + /* Cache the supported data types from the servers systypes table */ + if(dbcmd(H->link, "select usertype, name from systypes order by usertype") != FAIL) { + if(dbsqlexec(H->link) != FAIL) { + dbresults(H->link); + while (dbnextrow(H->link) == SUCCESS) { + val = dbdata(H->link, 1); + add_index_string(pdo_dblib_datatypes, *val, dbdata(H->link, 2), 1); + } + } + /* Throw out any remaining resultsets */ + dbcancel(H-link); + } +#endif + + + cleanup: - for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) { + for (i = 0; i < nvars; i++) { if (vars[i].freeme) { efree(vars[i].optval); } diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c index 1a2fefd47..51cebc48b 100644 --- a/ext/pdo_dblib/dblib_stmt.c +++ b/ext/pdo_dblib/dblib_stmt.c @@ -36,35 +36,51 @@ /* {{{ pdo_dblib_get_field_name * - * Updated for MSSQL 2008 SR2 extended types + * Return the data type name for a given TDS number * */ static char *pdo_dblib_get_field_name(int type) { + /* + * I don't return dbprtype(type) because it does not fully describe the type + * (example: varchar is reported as char by dbprtype) + * + * FIX ME: Cache datatypes from server systypes table in pdo_dblib_handle_factory() + * to make this future proof. + */ + switch (type) { + case 31: return "nvarchar"; case 34: return "image"; case 35: return "text"; case 36: return "uniqueidentifier"; + case 37: return "varbinary"; /* & timestamp - Sybase AS12 */ + case 38: return "bigint"; /* & bigintn - Sybase AS12 */ + case 39: return "varchar"; /* & sysname & nvarchar - Sybase AS12 */ case 40: return "date"; case 41: return "time"; case 42: return "datetime2"; case 43: return "datetimeoffset"; + case 45: return "binary"; /* Sybase AS12 */ + case 47: return "char"; /* & nchar & uniqueidentifierstr Sybase AS12 */ case 48: return "tinyint"; + case 50: return "bit"; /* Sybase AS12 */ case 52: return "smallint"; + case 55: return "decimal"; /* Sybase AS12 */ case 56: return "int"; case 58: return "smalldatetime"; case 59: return "real"; case 60: return "money"; case 61: return "datetime"; case 62: return "float"; + case 63: return "numeric"; /* or uint, ubigint, usmallint Sybase AS12 */ case 98: return "sql_variant"; case 99: return "ntext"; case 104: return "bit"; - case 106: return "decimal"; - case 108: return "numeric"; + case 106: return "decimal"; /* decimal n on sybase */ + case 108: return "numeric"; /* numeric n on sybase */ case 122: return "smallmoney"; case 127: return "bigint"; - case 240: return "geometry"; case 165: return "varbinary"; case 167: return "varchar"; case 173: return "binary"; @@ -72,23 +88,22 @@ static char *pdo_dblib_get_field_name(int type) case 189: return "timestamp"; case 231: return "nvarchar"; case 239: return "nchar"; + case 240: return "geometry"; case 241: return "xml"; - default: - return "unknown"; - break; + default: return "unknown"; } } /* }}} */ -static int dblib_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) +static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) { pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; pdo_dblib_db_handle *H = S->H; /* Cancel any pending results */ dbcancel(H->link); - - efree(stmt->columns); + + efree(stmt->columns); stmt->columns = NULL; return 1; @@ -98,7 +113,8 @@ static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) { pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; - dblib_dblib_stmt_cursor_closer(stmt TSRMLS_CC); + efree(stmt->columns); + stmt->columns = NULL; efree(S); @@ -113,7 +129,12 @@ static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) ret = dbresults(H->link); - if (ret == FAIL || ret == NO_MORE_RESULTS) { + if (FAIL == ret) { + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbresults() returned FAIL" TSRMLS_CC); + return 0; + } + + if(NO_MORE_RESULTS == ret) { return 0; } @@ -131,6 +152,8 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) dbsetuserdata(H->link, (BYTE*) &S->err); + pdo_dblib_stmt_cursor_closer(stmt TSRMLS_CC); + if (FAIL == dbcmd(H->link, stmt->active_query_string)) { return 0; } @@ -141,10 +164,6 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) ret = pdo_dblib_stmt_next_rowset(stmt TSRMLS_CC); - if (ret == 0) { - return 0; - } - stmt->row_count = DBCOUNT(H->link); stmt->column_count = dbnumcols(H->link); @@ -162,7 +181,12 @@ static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt, ret = dbnextrow(H->link); - if (ret == FAIL || ret == NO_MORE_ROWS) { + if (FAIL == ret) { + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbnextrow() returned FAIL" TSRMLS_CC); + return 0; + } + + if(NO_MORE_ROWS == ret) { return 0; } @@ -174,6 +198,10 @@ static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; pdo_dblib_db_handle *H = S->H; + if(colno >= stmt->column_count || colno < 0) { + return FAILURE; + } + struct pdo_column_data *col = &stmt->columns[colno]; col->name = (char*)dbcolname(H->link, colno+1); @@ -205,11 +233,12 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, } switch (coltype) { - case SQLCHAR: - case SQLTEXT: case SQLVARBINARY: case SQLBINARY: case SQLIMAGE: + case SQLTEXT: + /* FIXME: Above types should be returned as a stream as they can be VERY large */ + case SQLCHAR: case SQLVARCHAR: tmp_ptr = emalloc(*len + 1); memcpy(tmp_ptr, *ptr, *len); @@ -225,34 +254,26 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, *ptr = tmp_ptr; break; } -#ifdef SQLUNIQUE case SQLUNIQUE: { -#else - case 36: { /* FreeTDS hack, also used by ext/mssql */ -#endif *len = 36+1; tmp_ptr = emalloc(*len + 1); /* uniqueidentifier is a 16-byte binary number, convert to 32 char hex string */ -#ifdef SQLUNIQUE *len = dbconvert(NULL, SQLUNIQUE, *ptr, *len, SQLCHAR, tmp_ptr, *len); -#else - *len = dbconvert(NULL, 36, *ptr, *len, SQLCHAR, tmp_ptr, *len); -#endif php_strtoupper(tmp_ptr, *len); *ptr = tmp_ptr; break; } default: if (dbwillconvert(coltype, SQLCHAR)) { - tmp_len = 32 + (2 * (*len)); + tmp_len = 32 + (2 * (*len)); /* FIXME: We allocate more than we need here */ tmp_ptr = emalloc(tmp_len); *len = dbconvert(NULL, coltype, *ptr, *len, SQLCHAR, tmp_ptr, -1); *ptr = tmp_ptr; - } else { - *len = 0; - *ptr = NULL; - } + } else { + *len = 0; /* FIXME: Silently fails and returns null on conversion errors */ + *ptr = NULL; + } } *caller_frees = 1; @@ -270,17 +291,25 @@ static int pdo_dblib_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *re { pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; pdo_dblib_db_handle *H = S->H; - + DBTYPEINFO* dbtypeinfo; + + if(colno >= stmt->column_count || colno < 0) { + return FAILURE; + } + array_init(return_value); - DBTYPEINFO* dbtypeinfo; dbtypeinfo = dbcoltypeinfo(H->link, colno+1); + + if(!dbtypeinfo) return FAILURE; add_assoc_long(return_value, "max_length", dbcollen(H->link, colno+1) ); add_assoc_long(return_value, "precision", (int) dbtypeinfo->precision ); add_assoc_long(return_value, "scale", (int) dbtypeinfo->scale ); add_assoc_string(return_value, "column_source", dbcolsource(H->link, colno+1), 1); add_assoc_string(return_value, "native_type", pdo_dblib_get_field_name(dbcoltype(H->link, colno+1)), 1); + add_assoc_long(return_value, "native_type_id", dbcoltype(H->link, colno+1)); + add_assoc_long(return_value, "native_usertype_id", dbcolutype(H->link, colno+1)); return 1; } @@ -297,6 +326,6 @@ struct pdo_stmt_methods dblib_stmt_methods = { NULL, /* get attr */ pdo_dblib_stmt_get_column_meta, /* meta */ pdo_dblib_stmt_next_rowset, /* nextrow */ - dblib_dblib_stmt_cursor_closer + pdo_dblib_stmt_cursor_closer }; diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c index ed79aea20..bc5d364ed 100644 --- a/ext/pdo_dblib/pdo_dblib.c +++ b/ext/pdo_dblib/pdo_dblib.c @@ -93,8 +93,12 @@ int error_handler(DBPROCESS *dbproc, int severity, int dberr, char *state = "HY000"; TSRMLS_FETCH(); - einfo = (pdo_dblib_err*)dbgetuserdata(dbproc); - if (!einfo) einfo = &DBLIB_G(err); + if(dbproc) { + einfo = (pdo_dblib_err*)dbgetuserdata(dbproc); + if (!einfo) einfo = &DBLIB_G(err); + } else { + einfo = &DBLIB_G(err); + } einfo->severity = severity; einfo->oserr = oserr; diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h index dd06a1d94..2bdb83c32 100644 --- a/ext/pdo_dblib/php_pdo_dblib_int.h +++ b/ext/pdo_dblib/php_pdo_dblib_int.h @@ -71,6 +71,8 @@ # define SQLVARBINARY SYBVARBINARY # ifdef SYBUNIQUE # define SQLUNIQUE SYBUNIQUE +#else +# define SQLUNIQUE 36 /* FreeTDS Hack */ # endif # define DBERRHANDLE(a, b) dberrhandle(b) @@ -118,6 +120,12 @@ typedef struct { pdo_dblib_err err; } pdo_dblib_stmt; +typedef struct { + const char* key; + int value; +} pdo_dblib_keyval; + + ZEND_BEGIN_MODULE_GLOBALS(dblib) pdo_dblib_err err; char sqlstate[6]; diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index 5c3e435f7..2b57cd8ba 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -344,7 +344,7 @@ static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{ if (n >= 0) { *len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -var->sqlscale, n % f); - } else if (n < -f) { + } else if (n <= -f) { *len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -var->sqlscale, -n % f); } else { @@ -535,12 +535,14 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat int force_null; case IS_LONG: - var->sqltype = sizeof(long) == 8 ? SQL_INT64 : SQL_LONG; + /* keep the allow-NULL flag */ + var->sqltype = (sizeof(long) == 8 ? SQL_INT64 : SQL_LONG) | (var->sqltype & 1); var->sqldata = (void*)&Z_LVAL_P(param->parameter); var->sqllen = sizeof(long); break; case IS_DOUBLE: - var->sqltype = SQL_DOUBLE; + /* keep the allow-NULL flag */ + var->sqltype = SQL_DOUBLE | (var->sqltype & 1); var->sqldata = (void*)&Z_DVAL_P(param->parameter); var->sqllen = sizeof(double); break; @@ -560,7 +562,8 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat force_null = (Z_STRLEN_P(param->parameter) == 0); } if (!force_null) { - var->sqltype = SQL_TEXT; + /* keep the allow-NULL flag */ + var->sqltype = SQL_TEXT | (var->sqltype & 1); var->sqldata = Z_STRVAL_P(param->parameter); var->sqllen = Z_STRLEN_P(param->parameter); break; diff --git a/ext/pdo_firebird/tests/bug_62024.phpt b/ext/pdo_firebird/tests/bug_62024.phpt new file mode 100644 index 000000000..e046879c2 --- /dev/null +++ b/ext/pdo_firebird/tests/bug_62024.phpt @@ -0,0 +1,51 @@ +--TEST-- +Bug #62024 Cannot insert second row with null using parametrized query (Firebird PDO) +--SKIPIF-- +<?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php function_exists("ibase_query") or die("skip"); ?> +--FILE-- +<?php + +require("testdb.inc"); + +$dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die; +$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); +$value = '2'; +@$dbh->exec('DROP TABLE test_insert'); +$dbh->exec("CREATE TABLE test_insert (ID INTEGER NOT NULL, TEXT VARCHAR(10))"); + +$dbh->commit(); + +//start actual test + +$sql = "insert into test_insert (id, text) values (?, ?)"; +$sttmt = $dbh->prepare($sql); + +$args_ok = array(1, "test1"); +$args_err = array(2, null); + +$res = $sttmt->execute($args_ok); +var_dump($res); + +$res = $sttmt->execute($args_err); +var_dump($res); + +$dbh->commit(); + + +//teardown test data +$sttmt = $dbh->prepare('DELETE FROM test_insert'); +$sttmt->execute(); + +$dbh->commit(); + +$dbh->exec('DROP TABLE test_insert'); + +unset($sttmt); +unset($dbh); + +?> +--EXPECT-- +bool(true) +bool(true) + diff --git a/ext/pdo_firebird/tests/bug_64037.phpt b/ext/pdo_firebird/tests/bug_64037.phpt new file mode 100644 index 000000000..f7b53e57a --- /dev/null +++ b/ext/pdo_firebird/tests/bug_64037.phpt @@ -0,0 +1,45 @@ +--TEST-- +Bug #64037 Firebird return wrong value for numeric field +--SKIPIF-- +<?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php function_exists("ibase_query") or die("skip"); ?> +--FILE-- +<?php + +require("testdb.inc"); + +$dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die; +$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); +$value = '2'; +@$dbh->exec('DROP TABLE price'); +$dbh->exec("CREATE TABLE PRICE (ID INTEGER NOT NULL, TEXT VARCHAR(10), COST NUMERIC(15, 2))"); +$dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (1, 'test', -1.0)"); +$dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (2, 'test', -0.99)"); +$dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (3, 'test', -1.01)"); + +$dbh->commit(); + +$query = "SELECT * from price order by ID"; +$stmt = $dbh->prepare($query); +$stmt->execute(); +$rows = $stmt->fetchAll(); +var_dump($rows[0]['COST']); +var_dump($rows[1]['COST']); +var_dump($rows[2]['COST']); + + +$stmt = $dbh->prepare('DELETE FROM price'); +$stmt->execute(); + +$dbh->commit(); + +$dbh->exec('DROP TABLE price'); + +unset($stmt); +unset($dbh); + +?> +--EXPECT-- +string(5) "-1.00" +string(5) "-0.99" +string(5) "-1.01"
\ No newline at end of file diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index a703f93e7..32d13bafa 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -527,9 +527,9 @@ static struct pdo_dbh_methods mysql_methods = { /* }}} */ #ifdef PHP_WIN32 -# define MYSQL_UNIX_ADDR NULL +# define PDO_DEFAULT_MYSQL_UNIX_ADDR NULL #else -# define MYSQL_UNIX_ADDR PDO_MYSQL_G(default_socket) +# define PDO_DEFAULT_MYSQL_UNIX_ADDR PDO_MYSQL_G(default_socket) #endif /* {{{ pdo_mysql_handle_factory */ @@ -545,7 +545,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ { "dbname", "", 0 }, { "host", "localhost", 0 }, { "port", "3306", 0 }, - { "unix_socket", MYSQL_UNIX_ADDR, 0 }, + { "unix_socket", PDO_DEFAULT_MYSQL_UNIX_ADDR, 0 }, }; int connect_opts = 0 #ifdef CLIENT_MULTI_RESULTS diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 2ae559571..369c38946 100644 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -761,9 +761,12 @@ static char *type_to_name_native(int type) /* {{{ */ switch (type) { PDO_MYSQL_NATIVE_TYPE_NAME(STRING) PDO_MYSQL_NATIVE_TYPE_NAME(VAR_STRING) -#ifdef MYSQL_HAS_TINY +#ifdef FIELD_TYPE_TINY PDO_MYSQL_NATIVE_TYPE_NAME(TINY) #endif +#ifdef FIELD_TYPE_BIT + PDO_MYSQL_NATIVE_TYPE_NAME(BIT) +#endif PDO_MYSQL_NATIVE_TYPE_NAME(SHORT) PDO_MYSQL_NATIVE_TYPE_NAME(LONG) PDO_MYSQL_NATIVE_TYPE_NAME(LONGLONG) @@ -778,7 +781,7 @@ static char *type_to_name_native(int type) /* {{{ */ PDO_MYSQL_NATIVE_TYPE_NAME(GEOMETRY) #endif PDO_MYSQL_NATIVE_TYPE_NAME(TIMESTAMP) -#ifdef MYSQL_HAS_YEAR +#ifdef FIELD_TYPE_YEAR PDO_MYSQL_NATIVE_TYPE_NAME(YEAR) #endif PDO_MYSQL_NATIVE_TYPE_NAME(SET) diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c index 1dbb30f27..0d4e525cd 100644 --- a/ext/pdo_mysql/pdo_mysql.c +++ b/ext/pdo_mysql/pdo_mysql.c @@ -61,7 +61,7 @@ ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql) #include "ext/mysqlnd/mysqlnd_reverse_api.h" static MYSQLND * pdo_mysql_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC) { - if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJCE_P(zv) == php_pdo_get_dbh_ce()) { + if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), php_pdo_get_dbh_ce() TSRMLS_CC)) { pdo_dbh_t * dbh = zend_object_store_get_object(zv TSRMLS_CC); if (!dbh || dbh->driver != &pdo_mysql_driver) { diff --git a/ext/pdo_mysql/tests/bug63176.phpt b/ext/pdo_mysql/tests/bug63176.phpt new file mode 100644 index 000000000..ee928c093 --- /dev/null +++ b/ext/pdo_mysql/tests/bug63176.phpt @@ -0,0 +1,54 @@ +--TEST-- +Bug #63176 (Segmentation fault when instantiate 2 persistent PDO to the same db server) +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc'); +require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::skip(); +?> +--FILE-- +<?php +require(dirname(__FILE__). DIRECTORY_SEPARATOR . 'config.inc'); +class PDO2 extends PDO { + protected $transLevel; +} + +class PDO3 extends PDO { + protected $tomato; +} + + +class ModelA { + public function __construct($h) { + var_dump($h); + if ($h) { + $this->db = new PDO2(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT => true)); + } else { + $this->db = new PDO3(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT => true)); + } + $this->db->query('SELECT 1')->fetchAll(); + } +} + +$a = new ModelA(true); +$b = new ModelA(false); + +var_dump($a); +var_dump($b); +--EXPECTF-- +bool(true) +bool(false) +object(ModelA)#%d (1) { + ["db"]=> + object(PDO2)#%d (1) { + ["transLevel":protected]=> + NULL + } +} +object(ModelA)#%d (1) { + ["db"]=> + object(PDO2)#%d (1) { + ["transLevel":protected]=> + NULL + } +} diff --git a/ext/pdo_mysql/tests/mysql_pdo_test.inc b/ext/pdo_mysql/tests/mysql_pdo_test.inc index 115aeadc5..7a97bb463 100644 --- a/ext/pdo_mysql/tests/mysql_pdo_test.inc +++ b/ext/pdo_mysql/tests/mysql_pdo_test.inc @@ -162,8 +162,8 @@ class MySQLPDOTest extends PDOTest { phpinfo(); $tmp = ob_get_contents(); ob_end_clean(); - $tmp = stristr($tmp, "PDO Driver for MySQL => enabled"); - return (bool)preg_match('/Client API version.*mysqlnd/', $tmp); + return (preg_match('/PDO Driver for MySQL.*enabled/', $tmp) && + preg_match('/Client API version.*mysqlnd/', $tmp)); } static function dropTestTable($db = NULL) { @@ -174,4 +174,4 @@ class MySQLPDOTest extends PDOTest { } } -?>
\ No newline at end of file +?> diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt index b550cb8da..ebf22ef61 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt @@ -48,6 +48,7 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1')) } require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); + putenv('PDOTEST_ATTR='.serialize([PDO::MYSQL_ATTR_LOCAL_INFILE=>true])); $db = MySQLPDOTest::factory(); MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db)); diff --git a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt index a570c1fd4..74b4a7358 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt @@ -18,10 +18,9 @@ $db = MySQLPDOTest::factory(); ob_end_clean(); /* PDO Driver for MySQL, client library version => 6.0.3-alpha */ - $expected = sprintf('Client API version => %s', - $db->getAttribute(PDO::ATTR_CLIENT_VERSION)); + $reg = 'Client API version.*' . preg_quote($db->getAttribute(PDO::ATTR_CLIENT_VERSION), '/'); - if (false === stristr($tmp, $expected)) { + if (!preg_match("/$reg/", $tmp)) { printf("[001] Cannot find MySQL PDO driver line in phpinfo() output\n"); } diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt index 0fef33487..d2097f116 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt @@ -148,9 +148,9 @@ try { $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); $is_mysqlnd = MySQLPDOTest::isPDOMySQLnd(); - test_meta($db, 20, 'BIT(8)', 1, NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); - test_meta($db, 30, 'TINYINT', -127, NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); - test_meta($db, 40, 'TINYINT UNSIGNED', 255, NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); + test_meta($db, 20, 'BIT(8)', 1, 'BIT', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); + test_meta($db, 30, 'TINYINT', -127, 'TINY', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); + test_meta($db, 40, 'TINYINT UNSIGNED', 255, 'TINY', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 50, 'BOOLEAN', 1, NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 60, 'SMALLINT', -32768, 'SHORT', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); @@ -194,7 +194,7 @@ try { test_meta($db, 340, 'TIME', '14:37:00', 'TIME', PDO::PARAM_STR); test_meta($db, 350, 'TIMESTAMP', time(), 'TIMESTAMP', PDO::PARAM_STR); test_meta($db, 360, 'DATETIME', '2008-03-23 14:38:00', 'DATETIME', PDO::PARAM_STR); - test_meta($db, 370, 'YEAR', '2008', NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); + test_meta($db, 370, 'YEAR', '2008', 'YEAR', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 380, 'CHAR(1)', 'a', 'STRING', PDO::PARAM_STR); test_meta($db, 390, 'CHAR(10)', '0123456789', 'STRING', PDO::PARAM_STR); @@ -311,4 +311,4 @@ print "done!"; ?> --EXPECTF-- Testing native PS... -done!
\ No newline at end of file +done! diff --git a/ext/pdo_oci/config.m4 b/ext/pdo_oci/config.m4 index 309bde8a5..0e42d1f9a 100755 --- a/ext/pdo_oci/config.m4 +++ b/ext/pdo_oci/config.m4 @@ -2,7 +2,7 @@ dnl $Id$ dnl config.m4 for extension pdo_oci dnl vim:et:sw=2:ts=2: -SUPPORTED_LIB_VERS="9.0 10.1 11.1" # This caters for all Oracle 9.x, 10.x and 11.1 installs +SUPPORTED_LIB_VERS="9.0 10.1 11.1 12.1" # The lib vers are not bumped when the DB version is bumped AC_DEFUN([AC_PDO_OCI_VERSION],[ AC_MSG_CHECKING([Oracle version]) for OCI_VER in $SUPPORTED_LIB_VERS; do @@ -147,7 +147,7 @@ You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_ fi case $PDO_OCI_VERSION in - 9.0|10.1|10.2|11.1|11.2) + 9.0|10.1|10.2|11.1|11.2|12.1) PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD) ;; diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c index 5497bebc6..fcdefa94b 100644 --- a/ext/pdo_oci/oci_driver.c +++ b/ext/pdo_oci/oci_driver.c @@ -537,7 +537,9 @@ static int pdo_oci_check_liveness(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ { pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; sb4 error_code = 0; +#if (!((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2)))) char version[256]; +#endif /* TODO move attached check to PDO level */ if (H->attached == 0) { diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c index dcb955780..6a74efa7b 100644 --- a/ext/pdo_oci/oci_statement.c +++ b/ext/pdo_oci/oci_statement.c @@ -270,6 +270,12 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa P = (pdo_oci_bound_param*)param->driver_data; switch (event_type) { + case PDO_PARAM_EVT_FETCH_PRE: + case PDO_PARAM_EVT_FETCH_POST: + case PDO_PARAM_EVT_NORMALIZE: + /* Do nothing */ + break; + case PDO_PARAM_EVT_FREE: P = param->driver_data; if (P) { diff --git a/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt b/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt index 81e9b74ff..ab9b99fc6 100644 --- a/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt +++ b/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt @@ -1,5 +1,5 @@ --TEST-- -PDO_OCI: Atrribute: closing a connection in non-autocommit mode commits data +PDO_OCI: Attribute: closing a connection in non-autocommit mode commits data --SKIPIF-- <?php if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded'); diff --git a/ext/pdo_oci/tests/pdo_oci_attr_client.phpt b/ext/pdo_oci/tests/pdo_oci_attr_client.phpt index 372ccec8e..eadb028e0 100644 --- a/ext/pdo_oci/tests/pdo_oci_attr_client.phpt +++ b/ext/pdo_oci/tests/pdo_oci_attr_client.phpt @@ -18,7 +18,7 @@ $cv = $dbh->getAttribute(PDO::ATTR_CLIENT_VERSION); var_dump($cv); $s = explode(".", $cv); -if ($s[0] >= 10 && count($s) > 1 && $s[1] >= 2) { +if (count($s) > 1 && (($s[0] == 10 && $s[1] >= 2) || $s[0] >= 11)) { if (count($s) != 5) { echo "Wrong number of values in array\nVersion was: "; var_dump($cv); diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index 33163688e..f7f3ef34e 100644 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -263,7 +263,7 @@ out: static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type param_type TSRMLS_DC) { - pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; + /* pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; */ /* TODO: figure it out */ return 0; } diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 6ee2fcd6b..0e3fd3cbb 100644 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -286,6 +286,12 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p if (param->is_param) { switch (event_type) { + case PDO_PARAM_EVT_FETCH_PRE: + case PDO_PARAM_EVT_FETCH_POST: + case PDO_PARAM_EVT_NORMALIZE: + /* Do nothing */ + break; + case PDO_PARAM_EVT_FREE: P = param->driver_data; if (P) { @@ -543,7 +549,6 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) { pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; struct pdo_column_data *col = &stmt->columns[colno]; - zend_bool dyn = FALSE; RETCODE rc; SWORD colnamelen; SDWORD colsize, displaysize; @@ -614,7 +619,6 @@ static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned l /* if it is a column containing "long" data, perform late binding now */ if (C->is_long) { - unsigned long alloced = 4096; unsigned long used = 0; char *buf; RETCODE rc; diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index a54fccd0e..50136430a 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -76,7 +76,7 @@ int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char * einfo->errmsg = NULL; } - if (sqlstate == NULL) { + if (sqlstate == NULL || strlen(sqlstate) >= sizeof(pdo_error_type)) { strcpy(*pdo_err, "HY000"); } else { @@ -315,9 +315,9 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote case PDO_PARAM_LOB: /* escapedlen returned by PQescapeBytea() accounts for trailing 0 */ #ifdef HAVE_PQESCAPE_BYTEA_CONN - escaped = PQescapeByteaConn(H->server, unquoted, unquotedlen, &tmp_len); + escaped = PQescapeByteaConn(H->server, (unsigned char *)unquoted, (size_t)unquotedlen, &tmp_len); #else - escaped = PQescapeBytea(unquoted, unquotedlen, &tmp_len); + escaped = PQescapeBytea((unsigned char *)unquoted, (size_t)unquotedlen, &tmp_len); #endif *quotedlen = (int)tmp_len + 1; *quoted = emalloc(*quotedlen + 1); @@ -331,9 +331,9 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote *quoted = safe_emalloc(2, unquotedlen, 3); (*quoted)[0] = '\''; #ifndef HAVE_PQESCAPE_CONN - *quotedlen = PQescapeString(*quoted + 1, unquoted, unquotedlen); + *quotedlen = PQescapeString(*quoted + 1, unquoted, (size_t)unquotedlen); #else - *quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, unquotedlen, NULL); + *quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, (size_t)unquotedlen, NULL); #endif (*quoted)[*quotedlen + 1] = '\''; (*quoted)[*quotedlen + 2] = '\0'; diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index d58eebf8f..792ad2707 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -536,7 +536,7 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned *len = 0; return 0; } else { - char *tmp_ptr = PQunescapeBytea(*ptr, &tmp_len); + char *tmp_ptr = (char *)PQunescapeBytea((unsigned char *)*ptr, &tmp_len); if (!tmp_ptr) { /* PQunescapeBytea returned an error */ *len = 0; @@ -587,7 +587,7 @@ static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *return add_assoc_long(return_value, "pgsql:oid", S->cols[colno].pgsql_type); /* Fetch metadata from Postgres system catalogue */ - spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%d", S->cols[colno].pgsql_type); + spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%u", S->cols[colno].pgsql_type); res = PQexec(S->H->server, q); efree(q); diff --git a/ext/pdo_pgsql/tests/bug46274.phpt b/ext/pdo_pgsql/tests/bug46274.phpt index c34839ad4..40706ecaa 100644 --- a/ext/pdo_pgsql/tests/bug46274.phpt +++ b/ext/pdo_pgsql/tests/bug46274.phpt @@ -14,6 +14,11 @@ $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); +try { + @$db->query("SET bytea_output = 'escape'"); +} catch (Exception $e) { +} + $db->query('CREATE TABLE test_one_blob (id SERIAL NOT NULL, blob1 BYTEA)'); $stmt = $db->prepare("INSERT INTO test_one_blob (blob1) VALUES (:foo)"); diff --git a/ext/pdo_pgsql/tests/bug46274_2.phpt b/ext/pdo_pgsql/tests/bug46274_2.phpt index eb675afe9..df60f3454 100644 --- a/ext/pdo_pgsql/tests/bug46274_2.phpt +++ b/ext/pdo_pgsql/tests/bug46274_2.phpt @@ -14,6 +14,11 @@ $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); +try { + @$db->query("SET bytea_output = 'escape'"); +} catch (Exception $e) { +} + $db->query('CREATE TABLE test_one_blob (id SERIAL NOT NULL, blob1 BYTEA)'); $stmt = $db->prepare("INSERT INTO test_one_blob (blob1) VALUES (:foo)"); diff --git a/ext/pdo_pgsql/tests/bug64953.phpt b/ext/pdo_pgsql/tests/bug64953.phpt new file mode 100644 index 000000000..6e72bcab6 --- /dev/null +++ b/ext/pdo_pgsql/tests/bug64953.phpt @@ -0,0 +1,71 @@ +--TEST-- +PDO PgSQL Bug #64953 (Postgres prepared statement positional parameter casting) +--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 +echo "Test\n"; + +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); + +echo "Taken from the bug report:\n"; + +$st = $pdo->prepare('SELECT ?::char as i'); +$st->bindValue(1, '1'); +$st->execute(); +var_dump($st->fetch()); // return false + + +$st = $pdo->prepare('SELECT (?)::char as i'); +$st->bindValue(1, '1'); +$st->execute(); +var_dump($st->fetch()); // return array(1) { ["i"]=> string(1) "1" } + +echo "Something more nasty:\n"; + +$st = $pdo->prepare("SELECT :int::int as i"); +$st->execute(array(":int" => 123)); +var_dump($st->fetch()); + +$st = $pdo->prepare("SELECT '''?'''::text as \":text\""); +$st->execute(); +var_dump($st->fetch()); + +?> +Done +--EXPECT-- +Test +Taken from the bug report: +array(2) { + ["i"]=> + string(1) "1" + [0]=> + string(1) "1" +} +array(2) { + ["i"]=> + string(1) "1" + [0]=> + string(1) "1" +} +Something more nasty: +array(2) { + ["i"]=> + string(3) "123" + [0]=> + string(3) "123" +} +array(2) { + [":text"]=> + string(3) "'?'" + [0]=> + string(3) "'?'" +} +Done diff --git a/ext/pdo_pgsql/tests/bug_33876.phpt b/ext/pdo_pgsql/tests/bug_33876.phpt index 48618e13d..6a93905b4 100644 --- a/ext/pdo_pgsql/tests/bug_33876.phpt +++ b/ext/pdo_pgsql/tests/bug_33876.phpt @@ -82,7 +82,7 @@ else # false -> "" as string, which pgsql doesn't like if (!$res->execute(array(false))) { $err = $res->errorInfo(); - // Strip additional lines ouputted by recent PgSQL versions + // Strip additional lines outputted by recent PgSQL versions $err[2] = trim(current(explode("\n", $err[2]))); print_r($err); } else { diff --git a/ext/pdo_pgsql/tests/bug_49985.phpt b/ext/pdo_pgsql/tests/bug_49985.phpt index 26dcfc617..e1d7df82a 100644 --- a/ext/pdo_pgsql/tests/bug_49985.phpt +++ b/ext/pdo_pgsql/tests/bug_49985.phpt @@ -30,6 +30,6 @@ for ($i = 0; $i < 3; $i++) { ?> --EXPECTF-- bool(true) -SQLSTATE[23505]: %s"test_pkey" -SQLSTATE[23505]: %s"test_pkey" +SQLSTATE[23505]: %stest_pkey%s +SQLSTATE[23505]: %stest_pkey%s diff --git a/ext/pdo_pgsql/tests/copy_from.phpt b/ext/pdo_pgsql/tests/copy_from.phpt index 2858905d0..10967b0fe 100644 --- a/ext/pdo_pgsql/tests/copy_from.phpt +++ b/ext/pdo_pgsql/tests/copy_from.phpt @@ -110,8 +110,10 @@ $db->rollback(); echo "Exception! at line ", $e->getLine(), "\n"; var_dump($e->getMessage()); } -if(isset($filename)) { - @unlink($filename); + +// Clean up +foreach (array($filename, $filenameWithDifferentNullValues, $filenameWithDifferentNullValuesAndSelectedFields) as $f) { + @unlink($f); } ?> --EXPECT-- @@ -383,4 +385,4 @@ array(6) { NULL } Testing pgsqlCopyFromFile() with error -bool(false)
\ No newline at end of file +bool(false) diff --git a/ext/pdo_pgsql/tests/is_in_transaction.phpt b/ext/pdo_pgsql/tests/is_in_transaction.phpt index 99ff56162..72da4f4e0 100644 --- a/ext/pdo_pgsql/tests/is_in_transaction.phpt +++ b/ext/pdo_pgsql/tests/is_in_transaction.phpt @@ -57,10 +57,10 @@ var_dump($db->inTransaction()); ?> --EXPECT-- Test PDO::PGSQL_TRANSACTION_INTRANS -int(2) +bool(true) Test PDO::PGSQL_TRANSACTION_IDLE -int(0) +bool(false) Test PDO::PGSQL_TRANSACTION_INERROR -int(3) +bool(true) Test PDO::PGSQL_TRANSACTION_IDLE -int(0) +bool(false) diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt new file mode 100644 index 000000000..a1d890ac1 --- /dev/null +++ b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt @@ -0,0 +1,17 @@ +--TEST-- +PDO_sqlite: Testing sqliteCreateFunction() produces warning when +un-callable function passed +--CREDITS-- +Chris MacPherson chris@kombine.co.uk +--SKIPIF-- +<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?> +--FILE-- +<?php + +$db = new PDO( 'sqlite::memory:'); + +$db->sqliteCreateFunction('bar-alias', 'bar'); + +?> +--EXPECTF-- +Warning: PDO::sqliteCreateFunction(): function 'bar' is not callable in %s on line %d diff --git a/ext/pgsql/README b/ext/pgsql/README index 2b4c41233..785b4f034 100644 --- a/ext/pgsql/README +++ b/ext/pgsql/README @@ -35,7 +35,7 @@ names. Older names will become aliases of new functions for backward compatibility. -Manual will be updated when this change is commited to CVS source. +Manual will be updated when this change is committed to CVS source. ==== Configure Option Notes ==== You cannot specify PostgreSQL source directly to build PostgreSQL diff --git a/ext/pgsql/mysql_users.php b/ext/pgsql/mysql_users.php index 65a2c3396..edfaa1cdd 100644 --- a/ext/pgsql/mysql_users.php +++ b/ext/pgsql/mysql_users.php @@ -56,7 +56,7 @@ ORDER BY 1; /* * mysql_list_fields() * - * See also pg_meta_data(). It returns field defintion as array. + * See also pg_meta_data(). It returns field definition as array. */ function pg_list_fields($db, $table) { diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index d01dda603..f4c4cb37e 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -63,6 +63,7 @@ #define PGSQL_MAX_LENGTH_OF_LONG 30 #define PGSQL_MAX_LENGTH_OF_DOUBLE 60 +#if LONG_MAX < UINT_MAX #define PGSQL_RETURN_OID(oid) do { \ if (oid > LONG_MAX) { \ smart_str s = {0}; \ @@ -72,7 +73,9 @@ } \ RETURN_LONG((long)oid); \ } while(0) - +#else +#define PGSQL_RETURN_OID(oid) (RETURN_LONG((long)oid)) +#endif #if HAVE_PQSETNONBLOCKING #define PQ_SETNONBLOCKING(pg_link, flag) PQsetnonblocking(pg_link, flag) @@ -914,6 +917,82 @@ static void _free_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) } /* }}} */ + +static int _php_pgsql_detect_identifier_escape(const char *identifier, size_t len) +{ + size_t i; + + /* Handle edge case. Cannot be a escaped string */ + if (len <= 2) { + return FAILURE; + } + /* Detect double qoutes */ + if (identifier[0] == '"' && identifier[len-1] == '"') { + /* Detect wrong format of " inside of escaped string */ + for (i = 1; i < len-1; i++) { + if (identifier[i] == '"' && (identifier[++i] != '"' || i == len-1)) { + return FAILURE; + } + } + } else { + return FAILURE; + } + /* Escaped properly */ + return SUCCESS; +} + +#if !HAVE_PQESCAPELITERAL +/* {{{ _php_pgsql_escape_identifier + * Since PQescapeIdentifier() is unavailable (PostgreSQL 9.0 <), idenfifers + * should be escaped by pgsql module. + * Note: this function does not care for encoding. Therefore users should not + * use this with SJIS/BIG5 etc. (i.e. Encoding base injection may possible with + * before PostgreSQL 9.0) + */ +static char *_php_pgsql_escape_identifier(const char *field, size_t field_len) +{ + ulong field_escaped_len = field_len*2 + 3; + ulong i, j = 0; + char *field_escaped; + + field_escaped = (char *)malloc(field_escaped_len); + field_escaped[j++] = '"'; + for (i = 0; i < field_len; i++) { + if (field[i] == '"') { + field_escaped[j++] = '"'; + field_escaped[j++] = '"'; + } else { + field_escaped[j++] = field[i]; + } + } + field_escaped[j++] = '"'; + field_escaped[j] = '\0'; + return field_escaped; +} +/* }}} */ +#endif + +/* {{{ _php_pgsql_strndup, no strndup should be used */ +static char *_php_pgsql_strndup(const char *s, size_t len) +{ + char *new; + + if (NULL == s) { + return (char *)NULL; + } + + new = (char *) malloc(len + 1); + + if (NULL == new) { + return (char *)NULL; + } + + new[len] = '\0'; + + return memmove(new, s, len); +} +/* }}} */ + /* {{{ PHP_INI */ PHP_INI_BEGIN() @@ -4076,7 +4155,7 @@ PHP_FUNCTION(pg_escape_bytea) #ifdef HAVE_PQESCAPE_BYTEA_CONN if (pgsql_link != NULL || id != -1) { ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - to = (char *)PQescapeByteaConn(pgsql, from, (size_t)from_len, &to_len); + to = (char *)PQescapeByteaConn(pgsql, (unsigned char *)from, (size_t)from_len, &to_len); } else #endif to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len); @@ -4270,10 +4349,9 @@ static char* php_pgsql_PQescapeInternal(PGconn *conn, const char *str, size_t le #endif static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_literal) { - char *from = NULL, *to = NULL, *tmp = NULL; + char *from = NULL, *to = NULL; zval *pgsql_link = NULL; PGconn *pgsql; - int to_len; int from_len; int id = -1; @@ -4294,26 +4372,32 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l } if (pgsql_link == NULL && id == -1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get default pgsql link"); RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (pgsql == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get default pgsql link"); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get pgsql link"); RETURN_FALSE; } #ifdef HAVE_PQESCAPELITERAL - if (escape_literal) { - tmp = PQescapeLiteral(pgsql, from, (size_t)from_len); - } else { - tmp = PQescapeIdentifier(pgsql, from, (size_t)from_len); - } - if (!tmp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape"); - RETURN_FALSE; + /* Use a block with a local var to avoid unused variable warnings */ + { + char *tmp; + + if (escape_literal) { + tmp = PQescapeLiteral(pgsql, from, (size_t)from_len); + } else { + tmp = PQescapeIdentifier(pgsql, from, (size_t)from_len); + } + if (!tmp) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape"); + RETURN_FALSE; + } + to = estrdup(tmp); + PQfreemem(tmp); } - to = estrdup(tmp); - PQfreemem(tmp); #else to = php_pgsql_PQescapeInternal(pgsql, from, (size_t)from_len, escape_literal); if (!to) { @@ -4573,6 +4657,7 @@ PHP_FUNCTION(pg_send_query) PGconn *pgsql; PGresult *res; int leftover = 0; + int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &query, &len) == FAILURE) { @@ -4600,6 +4685,14 @@ PHP_FUNCTION(pg_send_query) RETURN_FALSE; } } + /* Wait to finish sending buffer */ + while ((ret = PQflush(pgsql))) { + if (ret == -1) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer"); + break; + } + usleep(10000); + } if (PQ_SETNONBLOCKING(pgsql, 0)) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); } @@ -4620,6 +4713,7 @@ PHP_FUNCTION(pg_send_query_params) PGconn *pgsql; PGresult *res; int leftover = 0; + int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa/", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) { return; @@ -4686,6 +4780,14 @@ PHP_FUNCTION(pg_send_query_params) } } _php_pgsql_free_params(params, num_params); + /* Wait to finish sending buffer */ + while ((ret = PQflush(pgsql))) { + if (ret == -1) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer"); + break; + } + usleep(10000); + } if (PQ_SETNONBLOCKING(pgsql, 0)) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); } @@ -4705,6 +4807,7 @@ PHP_FUNCTION(pg_send_prepare) PGconn *pgsql; PGresult *res; int leftover = 0; + int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) { return; @@ -4735,6 +4838,14 @@ PHP_FUNCTION(pg_send_prepare) RETURN_FALSE; } } + /* Wait to finish sending buffer */ + while ((ret = PQflush(pgsql))) { + if (ret == -1) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty postgres send buffer"); + break; + } + usleep(10000); + } if (PQ_SETNONBLOCKING(pgsql, 0)) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); } @@ -4757,6 +4868,7 @@ PHP_FUNCTION(pg_send_execute) PGconn *pgsql; PGresult *res; int leftover = 0; + int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) { return; @@ -4823,6 +4935,14 @@ PHP_FUNCTION(pg_send_execute) } } _php_pgsql_free_params(params, num_params); + /* Wait to finish sending buffer */ + while ((ret = PQflush(pgsql))) { + if (ret == -1) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty postgres send buffer"); + break; + } + usleep(10000); + } if (PQ_SETNONBLOCKING(pgsql, 0)) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); } @@ -4978,8 +5098,9 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z { PGresult *pg_result; char *src, *tmp_name, *tmp_name2 = NULL; + char *escaped; smart_str querystr = {0}; - int new_len; + size_t new_len; int i, num_rows; zval *elem; @@ -4998,23 +5119,36 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z } smart_str_appends(&querystr, - "SELECT a.attname, a.attnum, t.typname, a.attlen, a.attnotNULL, a.atthasdef, a.attndims " + "SELECT a.attname, a.attnum, t.typname, a.attlen, a.attnotnull, a.atthasdef, a.attndims, t.typtype = 'e' " "FROM pg_class as c, pg_attribute a, pg_type t, pg_namespace n " "WHERE a.attnum > 0 AND a.attrelid = c.oid AND c.relname = '"); - tmp_name2 = php_addslashes(tmp_name2, strlen(tmp_name2), &new_len, 0 TSRMLS_CC); - smart_str_appendl(&querystr, tmp_name2, new_len); - + escaped = (char *)safe_emalloc(strlen(tmp_name2), 2, 1); +#if HAVE_PQESCAPE_CONN + new_len = PQescapeStringConn(pg_link, escaped, tmp_name2, strlen(tmp_name2), NULL); +#else + new_len = PQescapeString(escaped, tmp_name2, strlen(tmp_name2)); +#endif + if (new_len) { + smart_str_appends(&querystr, escaped); + } + efree(escaped); + smart_str_appends(&querystr, "' AND c.relnamespace = n.oid AND n.nspname = '"); - tmp_name = php_addslashes(tmp_name, strlen(tmp_name), &new_len, 0 TSRMLS_CC); - smart_str_appendl(&querystr, tmp_name, new_len); + escaped = (char *)safe_emalloc(strlen(tmp_name), 2, 1); +#if HAVE_PQESCAPE_CONN + new_len = PQescapeStringConn(pg_link, escaped, tmp_name, strlen(tmp_name), NULL); +#else + new_len = PQescapeString(escaped, tmp_name, strlen(tmp_name)); +#endif + if (new_len) { + smart_str_appends(&querystr, escaped); + } + efree(escaped); smart_str_appends(&querystr, "' AND a.atttypid = t.oid ORDER BY a.attnum;"); smart_str_0(&querystr); - - efree(tmp_name2); - efree(tmp_name); - efree(src); - + efree(src); + pg_result = PQexec(pg_link, querystr.c); if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Table '%s' doesn't exists", table_name); @@ -5044,6 +5178,12 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z add_assoc_bool(elem, "has default", 0); } add_assoc_long(elem, "array dims", atoi(PQgetvalue(pg_result,i,6))); + if (!strcmp(PQgetvalue(pg_result,i,7), "t")) { + add_assoc_bool(elem, "is enum", 1); + } + else { + add_assoc_bool(elem, "is enum", 0); + } name = PQgetvalue(pg_result,i,0); add_assoc_zval(meta, name, elem); } @@ -5077,7 +5217,18 @@ PHP_FUNCTION(pg_meta_data) zval_dtor(return_value); /* destroy array */ RETURN_FALSE; } -} + else { + HashPosition pos; + zval **val; + + for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(return_value), &pos); + zend_hash_get_current_data_ex(Z_ARRVAL_P(return_value), (void **)&val, &pos) == SUCCESS; + zend_hash_move_forward_ex(Z_ARRVAL_P(return_value), &pos)) { + /* delete newly added entry, in order to keep BC */ + zend_hash_del_key_or_index(Z_ARRVAL_PP(val), "is enum", sizeof("is enum"), 0, HASH_DEL_KEY); + } + } +} /* }}} */ /* {{{ php_pgsql_get_data_type @@ -5220,6 +5371,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC) assert(Z_TYPE_P(src) == IS_STRING); assert(should_free == 1 || should_free == 0); + smart_str_appendc(&str, 'E'); smart_str_appendc(&str, '\''); smart_str_appendl(&str, Z_STRVAL_P(src), Z_STRLEN_P(src)); smart_str_appendc(&str, '\''); @@ -5259,8 +5411,9 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con char *field = NULL; uint field_len = -1; ulong num_idx = -1; - zval *meta, **def, **type, **not_null, **has_default, **val, *new_val; - int new_len, key_type, err = 0, skip_field; + zval *meta, **def, **type, **not_null, **has_default, **is_enum, **val, *new_val; + int key_type, err = 0, skip_field; + php_pgsql_data_type data_type; assert(pg_link != NULL); assert(Z_TYPE_P(values) == IS_ARRAY); @@ -5272,6 +5425,8 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } MAKE_STD_ZVAL(meta); array_init(meta); + +/* table_name is escaped by php_pgsql_meta_data */ if (php_pgsql_meta_data(pg_link, table_name, meta TSRMLS_CC) == FAILURE) { zval_dtor(meta); FREE_ZVAL(meta); @@ -5311,17 +5466,30 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'has default'"); err = 1; } + if (!err && zend_hash_find(Z_ARRVAL_PP(def), "is enum", sizeof("is enum"), (void **)&is_enum) == FAILURE) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'is enum'"); + err = 1; + } if (!err && (Z_TYPE_PP(val) == IS_ARRAY || Z_TYPE_PP(val) == IS_OBJECT || Z_TYPE_PP(val) == IS_CONSTANT_ARRAY)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scaler values as field values"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scalar values as field values"); err = 1; } if (err) { break; /* break out for() */ } ALLOC_INIT_ZVAL(new_val); - switch(php_pgsql_get_data_type(Z_STRVAL_PP(type), Z_STRLEN_PP(type))) + + if (Z_BVAL_PP(is_enum)) { + /* enums need to be treated like strings */ + data_type = PG_TEXT; + } + else { + data_type = php_pgsql_get_data_type(Z_STRVAL_PP(type), Z_STRLEN_PP(type)); + } + + switch(data_type) { case PG_BOOL: switch (Z_TYPE_PP(val)) { @@ -5471,15 +5639,15 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } else { Z_TYPE_P(new_val) = IS_STRING; -#if HAVE_PQESCAPE +#if HAVE_PQESCAPE_CONN { char *tmp; - tmp = (char *)safe_emalloc(Z_STRLEN_PP(val), 2, 1); - Z_STRLEN_P(new_val) = (int)PQescapeString(tmp, Z_STRVAL_PP(val), Z_STRLEN_PP(val)); + tmp = (char *)safe_emalloc(Z_STRLEN_PP(val), 2, 1); + Z_STRLEN_P(new_val) = (int)PQescapeStringConn(pg_link, tmp, Z_STRVAL_PP(val), Z_STRLEN_PP(val), NULL); Z_STRVAL_P(new_val) = tmp; } #else - Z_STRVAL_P(new_val) = php_addslashes(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &Z_STRLEN_P(new_val), 0 TSRMLS_CC); + Z_STRVAL_P(new_val) = (int)PQescapeString(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &Z_STRLEN_P(new_val), 0 TSRMLS_CC); #endif php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); } @@ -5765,10 +5933,11 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con else { unsigned char *tmp; size_t to_len; + smart_str s = {0}; #ifdef HAVE_PQESCAPE_BYTEA_CONN - tmp = PQescapeByteaConn(pg_link, Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len); + tmp = PQescapeByteaConn(pg_link, (unsigned char *)Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len); #else - tmp = PQescapeBytea(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len); + tmp = PQescapeBytea(Z_STRVAL_PP(val), (unsigned char *)Z_STRLEN_PP(val), &to_len); #endif Z_TYPE_P(new_val) = IS_STRING; Z_STRLEN_P(new_val) = to_len-1; /* PQescapeBytea's to_len includes additional '\0' */ @@ -5776,7 +5945,11 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con memcpy(Z_STRVAL_P(new_val), tmp, to_len); PQfreemem(tmp); php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); - + smart_str_appendl(&s, Z_STRVAL_P(new_val), Z_STRLEN_P(new_val)); + smart_str_0(&s); + efree(Z_STRVAL_P(new_val)); + Z_STRVAL_P(new_val) = s.c; + Z_STRLEN_P(new_val) = s.len; } break; @@ -5861,11 +6034,22 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con FREE_ZVAL(new_val); break; /* break out for() */ } + /* If field is NULL and HAS DEFAULT, should be skipped */ if (!skip_field) { - /* If field is NULL and HAS DEFAULT, should be skipped */ - field = php_addslashes(field, strlen(field), &new_len, 0 TSRMLS_CC); - add_assoc_zval(result, field, new_val); - efree(field); + char *escaped; + size_t field_len = strlen(field); + + if (_php_pgsql_detect_identifier_escape(field, field_len) == SUCCESS) { + escaped = _php_pgsql_strndup(field, field_len); + } else { +#if HAVE_PQESCAPELITERAL + escaped = PQescapeIdentifier(pg_link, field, field_len); +#else + escaped = _php_pgsql_escape_identifier(field, field_len); +#endif + } + add_assoc_zval(result, escaped, new_val); + free(escaped); } } /* for */ zval_dtor(meta); @@ -5940,6 +6124,45 @@ static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, ulong opt T return -1; } +static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const char *table) +{ + char *table_copy, *escaped, *token, *tmp; + size_t len; + + /* schame.table should be "schame"."table" */ + table_copy = estrdup(table); + token = php_strtok_r(table_copy, ".", &tmp); + len = strlen(token); + if (_php_pgsql_detect_identifier_escape(token, len) == SUCCESS) { + escaped = _php_pgsql_strndup(token, len); + } else { +#if HAVE_PQESCAPELITERAL + escaped = PQescapeIdentifier(pg_link, token, len); +#else + escaped = _php_pgsql_escape_identifier(token, len); +#endif + } + smart_str_appends(querystr, escaped); + free(escaped); + if (tmp && *tmp) { + len = strlen(tmp); + /* "schema"."table" format */ + if (_php_pgsql_detect_identifier_escape(tmp, len) == SUCCESS) { + escaped = _php_pgsql_strndup(tmp, len); + } else { +#if HAVE_PQESCAPELITERAL + escaped = PQescapeIdentifier(pg_link, tmp, len); +#else + escaped = _php_pgsql_escape_identifier(tmp, len); +#endif + } + smart_str_appendc(querystr, '.'); + smart_str_appends(querystr, escaped); + free(escaped); + } + efree(table_copy); +} + /* {{{ php_pgsql_insert */ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, ulong opt, char **sql TSRMLS_DC) @@ -5959,7 +6182,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var if (zend_hash_num_elements(Z_ARRVAL_P(var_array)) == 0) { smart_str_appends(&querystr, "INSERT INTO "); - smart_str_appends(&querystr, table); + build_tablename(&querystr, pg_link, table); smart_str_appends(&querystr, " DEFAULT VALUES"); goto no_values; @@ -5974,11 +6197,11 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var } var_array = converted; } - + smart_str_appends(&querystr, "INSERT INTO "); - smart_str_appends(&querystr, table); + build_tablename(&querystr, pg_link, table); smart_str_appends(&querystr, " ("); - + zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(var_array), &pos); while ((key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(var_array), &fld, &fld_len, &num_idx, 0, &pos)) != HASH_KEY_NON_EXISTANT) { @@ -6165,7 +6388,7 @@ PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var } smart_str_appends(&querystr, "UPDATE "); - smart_str_appends(&querystr, table); + build_tablename(&querystr, pg_link, table); smart_str_appends(&querystr, " SET "); if (build_assignment_string(&querystr, Z_ARRVAL_P(var_array), 0, ",", 1 TSRMLS_CC)) @@ -6266,7 +6489,7 @@ PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids } smart_str_appends(&querystr, "DELETE FROM "); - smart_str_appends(&querystr, table); + build_tablename(&querystr, pg_link, table); smart_str_appends(&querystr, " WHERE "); if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1 TSRMLS_CC)) @@ -6402,7 +6625,7 @@ PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids } smart_str_appends(&querystr, "SELECT * FROM "); - smart_str_appends(&querystr, table); + build_tablename(&querystr, pg_link, table); smart_str_appends(&querystr, " WHERE "); if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1 TSRMLS_CC)) diff --git a/ext/pgsql/tests/08escape.phpt b/ext/pgsql/tests/08escape.phpt index 90b4ed8a9..1bea35bf1 100644 --- a/ext/pgsql/tests/08escape.phpt +++ b/ext/pgsql/tests/08escape.phpt @@ -48,15 +48,24 @@ $sql = "INSERT INTO ".$table_name." (num, bin) VALUES (-9999, CAST ('".$escaped_ pg_query($db, $sql); // Retrieve binary from DB -$sql = "SELECT bin::bytea FROM ".$table_name." WHERE num = -9999"; -$result = pg_query($db, $sql); -$row = pg_fetch_array($result, 0, PGSQL_ASSOC); +for ($i = 0; $i < 2; $i++) { + $sql = "SELECT bin::bytea FROM ".$table_name." WHERE num = -9999"; + $result = pg_query($db, $sql); + $row = pg_fetch_array($result, 0, PGSQL_ASSOC); -if ($data === pg_unescape_bytea($row['bin'])) { - echo "pg_escape_bytea() actually works with database\n"; -} -else { - echo "pg_escape_bytea() is broken\n"; + if ($data === pg_unescape_bytea($row['bin'])) { + echo "pg_escape_bytea() actually works with database\n"; + break; + } + elseif (!$i) { + // Force bytea escaping and retry + @pg_query($db, "SET bytea_output = 'escape'"); + } + else { + $result = pg_query($db, $sql); + echo "pg_escape_bytea() is broken\n"; + break; + } } // pg_escape_literal/pg_escape_identifier @@ -92,4 +101,4 @@ pg_escape_string() is Ok pg_escape_bytea() is Ok pg_escape_bytea() actually works with database pg_escape_literal() is Ok -pg_escape_identifier() is Ok
\ No newline at end of file +pg_escape_identifier() is Ok diff --git a/ext/pgsql/tests/09notice.phpt b/ext/pgsql/tests/09notice.phpt index 316706916..67ef262fc 100644 --- a/ext/pgsql/tests/09notice.phpt +++ b/ext/pgsql/tests/09notice.phpt @@ -10,7 +10,7 @@ _skip_lc_messages(); ?> --INI-- pgsql.log_notice=1 -pgsql.ignore_notices=0 +pgsql.ignore_notice=0 --FILE-- <?php include 'config.inc'; diff --git a/ext/pgsql/tests/10pg_convert.phpt b/ext/pgsql/tests/10pg_convert.phpt index 73bf2b64e..adc2756e2 100644 --- a/ext/pgsql/tests/10pg_convert.phpt +++ b/ext/pgsql/tests/10pg_convert.phpt @@ -3,7 +3,7 @@ PostgreSQL pg_convert() --SKIPIF-- <?php include("skipif.inc"); -skip_server_version('8.5dev', '>='); +skip_bytea_not_escape(); ?> --FILE-- <?php @@ -20,10 +20,10 @@ var_dump($converted); ?> --EXPECT-- array(3) { - ["num"]=> + [""num""]=> string(4) "1234" - ["str"]=> - string(5) "'AAA'" - ["bin"]=> - string(5) "'BBB'" -} + [""str""]=> + string(6) "E'AAA'" + [""bin""]=> + string(6) "E'BBB'" +}
\ No newline at end of file diff --git a/ext/pgsql/tests/10pg_convert_85.phpt b/ext/pgsql/tests/10pg_convert_9.phpt index 4f1c92bf1..827c96250 100644 --- a/ext/pgsql/tests/10pg_convert_85.phpt +++ b/ext/pgsql/tests/10pg_convert_9.phpt @@ -1,9 +1,9 @@ --TEST-- -PostgreSQL pg_convert() (8.5+) +PostgreSQL pg_convert() (9.0+) --SKIPIF-- <?php include("skipif.inc"); -skip_server_version('8.5dev', '<'); +skip_bytea_not_hex(); ?> --FILE-- <?php @@ -12,6 +12,7 @@ error_reporting(E_ALL); include 'config.inc'; $db = pg_connect($conn_str); +pg_query($db, "SET standard_conforming_strings = 0"); $fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB'); $converted = pg_convert($db, $table_name, $fields); @@ -20,10 +21,10 @@ var_dump($converted); ?> --EXPECT-- array(3) { - ["num"]=> + [""num""]=> string(4) "1234" - ["str"]=> - string(5) "'AAA'" - ["bin"]=> - string(11) "'\\x424242'" -} + [""str""]=> + string(6) "E'AAA'" + [""bin""]=> + string(12) "E'\\x424242'" +}
\ No newline at end of file diff --git a/ext/pgsql/tests/12pg_insert.phpt b/ext/pgsql/tests/12pg_insert.phpt index f5cd868f8..9fd0dd1e3 100644 --- a/ext/pgsql/tests/12pg_insert.phpt +++ b/ext/pgsql/tests/12pg_insert.phpt @@ -3,7 +3,7 @@ PostgreSQL pg_insert() --SKIPIF-- <?php include("skipif.inc"); -skip_server_version('8.5dev', '>='); +skip_bytea_not_escape(); ?> --FILE-- <?php @@ -20,5 +20,5 @@ echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING)."\n"; echo "Ok\n"; ?> --EXPECT-- -INSERT INTO php_pgsql_test (num,str,bin) VALUES (1234,'AAA','BBB'); -Ok +INSERT INTO "php_pgsql_test" ("num","str","bin") VALUES (1234,E'AAA',E'BBB'); +Ok
\ No newline at end of file diff --git a/ext/pgsql/tests/12pg_insert_85.phpt b/ext/pgsql/tests/12pg_insert_9.phpt index a85dea036..329364ad6 100644 --- a/ext/pgsql/tests/12pg_insert_85.phpt +++ b/ext/pgsql/tests/12pg_insert_9.phpt @@ -1,9 +1,9 @@ --TEST-- -PostgreSQL pg_insert() (8.5+) +PostgreSQL pg_insert() (9.0+) --SKIPIF-- <?php include("skipif.inc"); -skip_server_version('8.5dev', '<'); +skip_bytea_not_hex(); ?> --FILE-- <?php @@ -12,6 +12,8 @@ error_reporting(E_ALL); include 'config.inc'; $db = pg_connect($conn_str); +pg_query($db, "SET standard_conforming_strings = 0"); + $fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB'); pg_insert($db, $table_name, $fields) or print "Error in test 1\n"; @@ -20,5 +22,5 @@ echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING)."\n"; echo "Ok\n"; ?> --EXPECT-- -INSERT INTO php_pgsql_test (num,str,bin) VALUES (1234,'AAA','\\x424242'); -Ok +INSERT INTO "php_pgsql_test" ("num","str","bin") VALUES (1234,E'AAA',E'\\x424242'); +Ok
\ No newline at end of file diff --git a/ext/pgsql/tests/13pg_select.phpt b/ext/pgsql/tests/13pg_select.phpt index f1504a8b1..db2ca06bf 100644 --- a/ext/pgsql/tests/13pg_select.phpt +++ b/ext/pgsql/tests/13pg_select.phpt @@ -33,5 +33,5 @@ array(1) { string(3) "BBB" } } -SELECT * FROM php_pgsql_test WHERE num=1234; +SELECT * FROM "php_pgsql_test" WHERE "num"=1234; Ok diff --git a/ext/pgsql/tests/13pg_select_85.phpt b/ext/pgsql/tests/13pg_select_9.phpt index e6d86bd6f..67adc9d21 100644 --- a/ext/pgsql/tests/13pg_select_85.phpt +++ b/ext/pgsql/tests/13pg_select_9.phpt @@ -1,9 +1,9 @@ --TEST-- -PostgreSQL pg_select() (8.5+) +PostgreSQL pg_select() (9.0+) --SKIPIF-- <?php include("skipif.inc"); -skip_server_version('8.5dev', '<'); +skip_server_version('9.0', '<'); ?> --FILE-- <?php @@ -12,6 +12,8 @@ error_reporting(E_ALL); include 'config.inc'; $db = pg_connect($conn_str); +pg_query("SET bytea_output = 'hex'"); + $fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ'); $ids = array('num'=>'1234'); @@ -33,5 +35,5 @@ array(1) { string(8) "\x424242" } } -SELECT * FROM php_pgsql_test WHERE num=1234; -Ok +SELECT * FROM "php_pgsql_test" WHERE "num"=1234; +Ok
\ No newline at end of file diff --git a/ext/pgsql/tests/14pg_update.phpt b/ext/pgsql/tests/14pg_update.phpt index b41dd1af8..347cac944 100644 --- a/ext/pgsql/tests/14pg_update.phpt +++ b/ext/pgsql/tests/14pg_update.phpt @@ -3,7 +3,7 @@ PostgreSQL pg_update() --SKIPIF-- <?php include("skipif.inc"); -skip_server_version('8.5dev', '>='); +skip_bytea_not_escape(); ?> --FILE-- <?php @@ -21,5 +21,5 @@ echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n"; echo "Ok\n"; ?> --EXPECT-- -UPDATE php_pgsql_test SET num=1234,str='ABC',bin='XYZ' WHERE num=1234; -Ok +UPDATE "php_pgsql_test" SET "num"=1234,"str"=E'ABC',"bin"=E'XYZ' WHERE "num"=1234; +Ok
\ No newline at end of file diff --git a/ext/pgsql/tests/14pg_update_85.phpt b/ext/pgsql/tests/14pg_update_9.phpt index f1c77eac1..e766c1f38 100644 --- a/ext/pgsql/tests/14pg_update_85.phpt +++ b/ext/pgsql/tests/14pg_update_9.phpt @@ -1,9 +1,9 @@ --TEST-- -PostgreSQL pg_update() (8.5+) +PostgreSQL pg_update() (9.0) --SKIPIF-- <?php include("skipif.inc"); -skip_server_version('8.5dev', '<'); +skip_bytea_not_hex(); ?> --FILE-- <?php @@ -12,6 +12,8 @@ error_reporting(E_ALL); include 'config.inc'; $db = pg_connect($conn_str); +pg_query($db, "SET standard_conforming_strings = 0"); + $fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ'); $ids = array('num'=>'1234'); @@ -21,5 +23,5 @@ echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n"; echo "Ok\n"; ?> --EXPECT-- -UPDATE php_pgsql_test SET num=1234,str='ABC',bin='\\x58595a' WHERE num=1234; -Ok +UPDATE "php_pgsql_test" SET "num"=1234,"str"=E'ABC',"bin"=E'\\x58595a' WHERE "num"=1234; +Ok
\ No newline at end of file diff --git a/ext/pgsql/tests/18pg_escape_bytea_before.phpt b/ext/pgsql/tests/18pg_escape_bytea_before.phpt new file mode 100644 index 000000000..492517733 --- /dev/null +++ b/ext/pgsql/tests/18pg_escape_bytea_before.phpt @@ -0,0 +1,30 @@ +--TEST-- +PostgreSQL pg_escape_bytea() functions (before connection) +--SKIPIF-- +<?php include("skipif.inc"); ?> +--FILE-- +<?php +// optional functions + +include('config.inc'); + +$image = file_get_contents(dirname(__FILE__) . '/php.gif'); +$esc_image = pg_escape_bytea($image); + +$db = pg_connect($conn_str); +@pg_query($db, "SET bytea_output = 'escape'"); + +pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, E\''.$esc_image.'\');'); +$result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876'); +$rows = pg_fetch_all($result); +$unesc_image = pg_unescape_bytea($rows[0]['bin']); + +if ($unesc_image !== $image) { + echo "NG"; +} +else { + echo "OK"; +} +?> +--EXPECT-- +OK diff --git a/ext/pgsql/tests/18pg_escape_bytea.phpt b/ext/pgsql/tests/18pg_escape_bytea_esc.phpt index 43f98c446..38e5777c3 100644 --- a/ext/pgsql/tests/18pg_escape_bytea.phpt +++ b/ext/pgsql/tests/18pg_escape_bytea_esc.phpt @@ -1,5 +1,5 @@ --TEST-- -PostgreSQL pg_escape_bytea() functions +PostgreSQL pg_escape_bytea() functions (escape format) --SKIPIF-- <?php include("skipif.inc"); ?> --FILE-- @@ -8,10 +8,12 @@ PostgreSQL pg_escape_bytea() functions include('config.inc'); +$db = pg_connect($conn_str); +@pg_query($db, "SET bytea_output = 'escape'"); + $image = file_get_contents(dirname(__FILE__) . '/php.gif'); $esc_image = pg_escape_bytea($image); -$db = pg_connect($conn_str); pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');'); $result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876'); $rows = pg_fetch_all($result); diff --git a/ext/pgsql/tests/18pg_escape_bytea_hex.phpt b/ext/pgsql/tests/18pg_escape_bytea_hex.phpt new file mode 100644 index 000000000..04630bbbf --- /dev/null +++ b/ext/pgsql/tests/18pg_escape_bytea_hex.phpt @@ -0,0 +1,33 @@ +--TEST-- +PostgreSQL pg_escape_bytea() functions (hex format) +--SKIPIF-- +<?php +include("skipif.inc"); +skip_bytea_not_hex(); +?> +--FILE-- +<?php +// optional functions + +include('config.inc'); + +$db = pg_connect($conn_str); +@pg_query($db, "SET bytea_output = 'hex'"); + +$image = file_get_contents(dirname(__FILE__) . '/php.gif'); +$esc_image = pg_escape_bytea($image); + +pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');'); +$result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876'); +$rows = pg_fetch_all($result); +$unesc_image = pg_unescape_bytea($rows[0]['bin']); + +if ($unesc_image !== $image) { + echo "NG"; +} +else { + echo "OK"; +} +?> +--EXPECT-- +OK diff --git a/ext/pgsql/tests/80_bug32223.phpt b/ext/pgsql/tests/80_bug32223.phpt index 573742c6e..cad5fb3a1 100644 --- a/ext/pgsql/tests/80_bug32223.phpt +++ b/ext/pgsql/tests/80_bug32223.phpt @@ -15,6 +15,8 @@ end; ' LANGUAGE plpgsql;"); if (!$res) die('skip PLPGSQL not available'); ?> +--INI-- +pgsql.ignore_notice=0 --FILE-- <?php diff --git a/ext/pgsql/tests/80_bug32223b.phpt b/ext/pgsql/tests/80_bug32223b.phpt index aada3f01b..e79685c43 100644 --- a/ext/pgsql/tests/80_bug32223b.phpt +++ b/ext/pgsql/tests/80_bug32223b.phpt @@ -15,6 +15,8 @@ end; ' LANGUAGE plpgsql;"); if (!$res) die('skip PLPGSQL not available'); ?> +--INI-- +pgsql.ignore_notice=0 --FILE-- <?php diff --git a/ext/pgsql/tests/80_bug36625.phpt b/ext/pgsql/tests/80_bug36625.phpt index a95cea711..9cc8a1d4f 100644 --- a/ext/pgsql/tests/80_bug36625.phpt +++ b/ext/pgsql/tests/80_bug36625.phpt @@ -37,6 +37,8 @@ array_walk($trace, 'search_trace_file'); var_dump($found > 0); var_dump(file_exists($tracefile)); +@unlink($tracefile); + ?> ===DONE=== --CLEAN-- diff --git a/ext/pgsql/tests/bug37100.phpt b/ext/pgsql/tests/bug37100.phpt index fa6b9ba9e..3faecc671 100644 --- a/ext/pgsql/tests/bug37100.phpt +++ b/ext/pgsql/tests/bug37100.phpt @@ -3,7 +3,7 @@ Bug #37100 (data is returned truncated with BINARY CURSOR) --SKIPIF-- <?php include("skipif.inc"); -skip_server_version('8.5dev', '>='); +skip_bytea_not_escape(); ?> --FILE-- <?php @@ -11,6 +11,7 @@ skip_server_version('8.5dev', '>='); include 'config.inc'; $db = pg_connect($conn_str); +@pg_query("SET bytea_output = 'escape'"); @pg_query('DROP TABLE test_bug'); diff --git a/ext/pgsql/tests/bug37100_85.phpt b/ext/pgsql/tests/bug37100_9.phpt index aa2477626..9f4160d12 100644 --- a/ext/pgsql/tests/bug37100_85.phpt +++ b/ext/pgsql/tests/bug37100_9.phpt @@ -1,9 +1,9 @@ --TEST-- -Bug #37100 (data is returned truncated with BINARY CURSOR) (8.5+) +Bug #37100 (data is returned truncated with BINARY CURSOR) (9.0+) --SKIPIF-- <?php include("skipif.inc"); -skip_server_version('8.5dev', '<'); +skip_bytea_not_hex(); ?> --FILE-- <?php diff --git a/ext/pgsql/tests/bug47199.phpt b/ext/pgsql/tests/bug47199.phpt index 5bfac0b1b..faa787fd5 100644 --- a/ext/pgsql/tests/bug47199.phpt +++ b/ext/pgsql/tests/bug47199.phpt @@ -52,8 +52,8 @@ array(2) { string(1) "2" } } -DELETE FROM test_47199 WHERE null_field IS NULL AND not_null_field=2; -UPDATE test_47199 SET null_field=NULL,not_null_field=0 WHERE not_null_field=1 AND null_field IS NULL; +DELETE FROM "test_47199" WHERE "null_field" IS NULL AND "not_null_field"=2; +UPDATE "test_47199" SET "null_field"=NULL,"not_null_field"=0 WHERE "not_null_field"=1 AND "null_field" IS NULL; array(1) { [0]=> array(2) { diff --git a/ext/pgsql/tests/bug64609.phpt b/ext/pgsql/tests/bug64609.phpt new file mode 100644 index 000000000..72fac7648 --- /dev/null +++ b/ext/pgsql/tests/bug64609.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #64609 (pg_convert enum type support) +--SKIPIF-- +<?php +include("skipif.inc"); +skip_server_version('8.3', '<'); +?> +--FILE-- +<?php +error_reporting(E_ALL); + +include 'config.inc'; + +$db = pg_connect($conn_str); +pg_query("BEGIN"); +pg_query("CREATE TYPE t_enum AS ENUM ('ok', 'ko')"); +pg_query("CREATE TABLE test_enum (a t_enum)"); + +$fields = array('a' => 'ok'); +$converted = pg_convert($db, 'test_enum', $fields); + +pg_query("ROLLBACK"); + +var_dump($converted); +?> +--EXPECT-- +array(1) { + [""a""]=> + string(5) "E'ok'" +}
\ No newline at end of file diff --git a/ext/pgsql/tests/config.inc b/ext/pgsql/tests/config.inc index 2b5f05a71..d4bbb3382 100644 --- a/ext/pgsql/tests/config.inc +++ b/ext/pgsql/tests/config.inc @@ -2,7 +2,7 @@ // These vars are used to connect db and create test table. // values can be set to meet your environment -$conn_str = "host=localhost dbname=test"; // connection string +$conn_str = "host=localhost dbname=test port=5432"; // connection string $table_name = "php_pgsql_test"; // test table that should be exist $num_test_record = 1000; // Number of records to create diff --git a/ext/pgsql/tests/pg_delete_001.phpt b/ext/pgsql/tests/pg_delete_001.phpt index abb65be14..a98c95dc4 100644 --- a/ext/pgsql/tests/pg_delete_001.phpt +++ b/ext/pgsql/tests/pg_delete_001.phpt @@ -45,8 +45,8 @@ pg_query('DROP SCHEMA phptests'); ?> --EXPECTF-- -string(37) "DELETE FROM foo WHERE id=1 AND id2=2;" -string(46) "DELETE FROM phptests.foo WHERE id=2 AND id2=3;" +string(43) "DELETE FROM "foo" WHERE "id"=1 AND "id2"=2;" +string(54) "DELETE FROM "phptests"."foo" WHERE "id"=2 AND "id2"=3;" array(2) { [0]=> array(2) { diff --git a/ext/pgsql/tests/pg_insert_001.phpt b/ext/pgsql/tests/pg_insert_001.phpt index 7d2721918..626d4d0f8 100644 --- a/ext/pgsql/tests/pg_insert_001.phpt +++ b/ext/pgsql/tests/pg_insert_001.phpt @@ -28,7 +28,7 @@ pg_query('DROP SCHEMA phptests'); --EXPECTF-- Warning: pg_insert(): Table 'foo' doesn't exists in %s on line %d -string(47) "INSERT INTO phptests.foo (id,id2) VALUES (1,2);" +string(55) "INSERT INTO "phptests"."foo" ("id","id2") VALUES (1,2);" array(1) { [0]=> array(2) { diff --git a/ext/pgsql/tests/pg_update_001.phpt b/ext/pgsql/tests/pg_update_001.phpt index 95fa69256..60db35c15 100644 --- a/ext/pgsql/tests/pg_update_001.phpt +++ b/ext/pgsql/tests/pg_update_001.phpt @@ -35,8 +35,8 @@ pg_query('DROP SCHEMA phptests'); ?> --EXPECT-- -string(32) "UPDATE foo SET id=10 WHERE id=1;" -string(43) "UPDATE phptests.foo SET id=100 WHERE id2=2;" +string(38) "UPDATE "foo" SET "id"=10 WHERE "id"=1;" +string(51) "UPDATE "phptests"."foo" SET "id"=100 WHERE "id2"=2;" array(2) { ["id"]=> string(2) "10" diff --git a/ext/pgsql/tests/skipif.inc b/ext/pgsql/tests/skipif.inc index 7c5153e6f..83904af4f 100644 --- a/ext/pgsql/tests/skipif.inc +++ b/ext/pgsql/tests/skipif.inc @@ -17,15 +17,28 @@ if (!is_resource($conn)) { die("skip could not connect\n"); } -function skip_server_version($version, $op = '<') { _skip_version('server', $version, $op); } -function skip_client_version($version, $op = '<') { _skip_version('client', $version, $op); } +function skip_server_version($version, $op = '<') +{ + $pg = pg_parameter_status('server_version'); + if (version_compare($pg, $version, $op)) { + die("skip Server version {$pg} is {$op} {$version}\n"); + } + return $pg; +} +function skip_bytea_not_hex() +{ + $out = pg_escape_bytea("\xFF"); + if (strpos($out, '377') !== false) { + die("skip libpq or backend < 9.0\n"); + } +} -function _skip_version($type, $version, $op) +function skip_bytea_not_escape() { - $pg = pg_parameter_status($type.'_version'); - if (version_compare($pg, $version, $op)) { - die("skip {$type} version {$pg} is {$op} {$version}\n"); + $out = pg_escape_bytea("\xFF"); + if (strpos($out, '377') === false) { + die("skip libpq or backend >= 9.0\n"); } } diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag index b1c820f27..ed6de9fd6 100644 --- a/ext/phar/Makefile.frag +++ b/ext/phar/Makefile.frag @@ -40,3 +40,7 @@ install-pharcmd: pharcmd $(INSTALL) $(builddir)/phar.phar $(INSTALL_ROOT)$(bindir) -@rm -f $(INSTALL_ROOT)$(bindir)/phar $(LN_S) -f $(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar + @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1 + @$(INSTALL_DATA) $(builddir)/phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.1 + @$(INSTALL_DATA) $(builddir)/phar.phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.phar.1 + diff --git a/ext/phar/config.m4 b/ext/phar/config.m4 index 2ac7f3dd8..d424060f2 100644 --- a/ext/phar/config.m4 +++ b/ext/phar/config.m4 @@ -27,4 +27,6 @@ if test "$PHP_PHAR" != "no"; then PHP_ADD_EXTENSION_DEP(phar, hash, true) PHP_ADD_EXTENSION_DEP(phar, spl, true) PHP_ADD_MAKEFILE_FRAGMENT + + PHP_OUTPUT(ext/phar/phar.1 ext/phar/phar.phar.1) fi diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 65193726d..00cb92ff1 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -733,7 +733,7 @@ notfound: PHAR_G(cwd_len) = save_len; efree(entry); efree(arch); - /* Error Occured */ + /* Error Occurred */ if (!IS_EXISTS_CHECK(type)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename); } diff --git a/ext/phar/phar.1.in b/ext/phar/phar.1.in new file mode 100644 index 000000000..259a2bae8 --- /dev/null +++ b/ext/phar/phar.1.in @@ -0,0 +1,523 @@ +.TH PHAR 1 "2013" "The PHP Group" "User Commands" +.SH NAME +phar, phar.phar \- PHAR (PHP archive) command line tool +.SH SYNOPSIS +.B phar +<command> [options] ... +.LP +.SH DESCRIPTION +The \fBPHAR\fP file format provides a way to put entire PHP applications into a single +file called a "phar" (PHP Archive) for easy distribution and installation. +.P +With the \fBphar\fP command you can create, update or extract PHP archives. +.P +Commands: +add compress delete extract help help-list info list meta-del +meta-get meta-set pack sign stub-get stub-set tree version + +.SH add command +Add entries to a PHAR package. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.TP +.PD +.B ... +Any number of input files and directories. If -i is in +use then ONLY files and matching the given regular +expression are being packed. If -x is given then files +matching that regular expression are NOT being packed. +.P +Optional arguments: +.TP 15 +.PD +.B \-a \fIalias\fP +Provide an \fIalias\fP name for the phar file. +.TP +.PD +.B \-c \fIalgo\fP +Compression algorithm (see +.SM +.B COMPRESSION +) +.TP +.PD +.B \-i \fIregex\fP +Specifies a regular expression for input files. +.TP +.PD +.B \-l \fIlevel\fP +Number of preceding subdirectories to strip from file entries +.TP +.PD +.B \-x \fIregex\fP +Regular expression for input files to exclude. + +.SH compress command +Compress or uncompress all files or a selected entry. +.P +Required arguments: +.TP 15 +.PD +.B \-c \fIalgo\fP +Compression algorithm (see +.SM +.B COMPRESSION +) +.TP +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -e \fIentry\fP +Name of \fIentry\fP to work on (must include PHAR internal +directory name if any). + +.SH delete command +Delete entry from a PHAR archive +.P +Required arguments: +.TP 15 +.PD +.B \-e \fIentry\fP +Name of \fIentry\fP to work on (must include PHAR internal +directory name if any). +.TP +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. + +.SH extract command +Extract a PHAR package to a directory. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -i \fIregex\fP +Specifies a regular expression for input files. +.TP +.PD +.B -x \fIregex\fP +Regular expression for input files to exclude. +.TP +.PD +.B ... +Directory to extract to (defaults to '.'). + + +.SH help command +This help or help for a selected command. +.P +Optional arguments: +.TP 15 +.PD +.B ... +Optional command to retrieve help for. + +.SH help-list command +Lists available commands. + +.SH info command +Get information about a PHAR package. +.P +By using -k it is possible to return a single value. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -k \fIindex\fP +Subscription \fIindex\fP to work on. + +.SH list command +List contents of a PHAR archive. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -i \fIregex\fP +Specifies a regular expression for input files. +.TP +.PD +.B -x \fIregex\fP +Regular expression for input files to exclude. + + +.SH meta-del command +Delete meta information of a PHAR entry or a PHAR package. +.P +If -k is given then the metadata is expected to be an array and the +given index is being deleted. +.P +If something was deleted the return value is 0 otherwise it is 1. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -e \fIentry\fP +Name of \fIentry\fP to work on (must include PHAR internal +directory name if any). +.TP +.PD +.B -k \fIindex\fP +Subscription \fIindex\fP to work on. + +.SH meta-get command +Get meta information of a PHAR entry or a PHAR package in serialized from. If +no output file is specified for meta data then stdout is being used. +You can also specify a particular index using -k. In that case the +metadata is expected to be an array and the value of the given index +is returned using echo rather than using serialize. If that index does +not exist or no meta data is present then the return value is 1. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -e \fIentry\fP +Name of \fIentry\fP to work on (must include PHAR internal +directory name if any). +.TP +.PD +.B -k \fIindex\fP +Subscription \fIindex\fP to work on. + +.SH meta-set command +Set meta data of a PHAR entry or a PHAR package using serialized input. If no +input file is specified for meta data then stdin is being used. You can +also specify a particular index using -k. In that case the metadata is +expected to be an array and the value of the given index is being set. +If the metadata is not present or empty a new array will be created. +If the metadata is present and a flat value then the return value is +1. Also using -k the input is been taken directly rather then being +serialized. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.TP +.PD +.B -m \fImeta\fP +Meta data to store with entry (serialized php data). +.P +Optional arguments: +.TP 15 +.PD +.B -e \fIentry\fP +Name of \fIentry\fP to work on (must include PHAR internal +directory name if any). +.TP +.PD +.B -k \fIindex\fP +Subscription \fIindex\fP to work on. + +.SH pack command +Pack files into a PHAR archive. +.P +When using -s <stub>, then the stub file is being excluded from the +list of input files/dirs.To create an archive that contains PEAR class +PHP_Archive then point -p argument to PHP/Archive.php. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.TP +.PD +.B ... +Any number of input files and directories. If -i is in +use then ONLY files and matching the given regular +expression are being packed. If -x is given then files +matching that regular expression are NOT being packed. +.P +Optional arguments: +.TP 15 +.PD +.B \-a \fIalias\fP +Provide an \fIalias\fP name for the phar file. +.TP +.PD +.B \-b \fIbang\fP +Hash-bang line to start the archive (e.g. #!/usr/bin/php). +The hash mark itself '#!' and the newline character are optional. +.TP +.PD +.B \-c \fIalgo\fP +Compression algorithm (see +.SM +.B COMPRESSION +) +.TP +.PD +.B \-h \fIhash\fP +Selects the \fIhash\fP algorithm (see +.SM +.B HASH +) +.TP +.PD +.B \-i \fIregex\fP +Specifies a regular expression for input files. +.TP +.PD +.B \-l \fIlevel\fP +Number of preceding subdirectories to strip from file entries +.TP +.PD +.B \-p \fIloader\fP +Location of PHP_Archive class file (pear list-files +PHP_Archive).You can use '0' or '1' to locate it +automatically using the mentioned pear command. When +using '0' the command does not error out when the class +file cannot be located. This switch also adds some code +around the stub so that class PHP_Archive gets +registered as phar:// stream wrapper if necessary. And +finally this switch will add the file phar.inc from +this package and load it to ensure class Phar is +present. +.TP +.PD +.B \-s \fIstub\fP +Select the \fIstub\fP file. +.TP +.PD +.B \-x \fIregex\fP +Regular expression for input files to exclude. +.TP +.PD +.B \-y \fIkey\fP +Private \fIkey\fP for OpenSSL signing. + +.SH sign command +Set signature hash algorithm. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.TP +.PD +.B \-h \fIhash\fP +Selects the \fIhash\fP algorithm (see +.SM +.B HASH +) +.P +Optional arguments: +.TP 15 +.PD +.B \-y \fIkey\fP +Private \fIkey\fP for OpenSSL signing. + +.SH stub-get command +Get the stub of a PHAR file. If no output file is specified as stub then stdout +is being used. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B \-s \fIstub\fP +Select the \fIstub\fP file. + +.SH stub-set command +Set the stub of a PHAR file. If no input file is specified as stub then stdin +is being used. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B \-b \fIbang\fP +Hash-bang line to start the archive (e.g. #!/usr/bin/php). +The hash mark itself '#!' and the newline character are optional. +.TP +.PD +.B \-p \fIloader\fP +Location of PHP_Archive class file (pear list-files +PHP_Archive).You can use '0' or '1' to locate it +automatically using the mentioned pear command. When +using '0' the command does not error out when the class +file cannot be located. This switch also adds some code +around the stub so that class PHP_Archive gets +registered as phar:// stream wrapper if necessary. And +finally this switch will add the file phar.inc from +this package and load it to ensure class Phar is +present. +.TP +.PD +.B \-s \fIstub\fP +Select the \fIstub\fP file. + + +.SH tree command +Get a directory tree for a PHAR archive. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B \-i \fIregex\fP +Specifies a regular expression for input files. +.TP +.PD +.B \-x \fIregex\fP +Regular expression for input files to exclude. + +.SH version command +Get information about the PHAR environment and the tool version. + + +.SH COMPRESSION +Algorithms: +.TP 15 +.PD +.B 0 +No compression +.TP +.PD +.B none +No compression +.TP +.PD +.B auto +Automatically select compression algorithm +.TP +.PD +.B gz +GZip compression +.TP +.PD +.B gzip +GZip compression +.TP +.PD +.B bz2 +BZip2 compression +.TP +.PD +.B bzip2 +BZip2 compression + +.SH HASH +Algorithms: +.TP 15 +.PD +.TP +.PD +.B md5 +MD5 +.TP +.PD +.B sha1 +SHA1 +.TP +.PD +.B sha256 +SHA256 +.TP +.PD +.B sha512 +SHA512 +.TP +.PD +.B openssl +OpenSSL + +.SH SEE ALSO +For a more or less complete description of PHAR look here: +.PD 0 +.P +.B http://php.net/phar +.PD 1 +.P +.SH BUGS +You can view the list of known bugs or report any new bug you +found at: +.PD 0 +.P +.B http://bugs.php.net +.PD 1 +.SH AUTHORS +The PHP Group: Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski. +.P +Work for the PHP archive was done by Gregory Beaver, Marcus Boerger. +.P +A List of active developers can be found here: +.PD 0 +.P +.B http://www.php.net/credits.php +.PD 1 +.P +And last but not least PHP was developed with the help of a huge amount of +contributors all around the world. +.SH VERSION INFORMATION +This manpage describes \fBphar\fP, version @PHP_VERSION@. +.SH COPYRIGHT +Copyright \(co 1997\-2013 The PHP Group +.LP +This source file is subject to version 3.01 of the PHP license, +that is bundled with this package in the file LICENSE, and is +available through the world-wide-web at the following url: +.PD 0 +.P +.B http://www.php.net/license/3_01.txt +.PD 1 +.P +If you did not receive a copy of the PHP license and are unable to +obtain it through the world-wide-web, please send a note to +.B license@php.net +so we can mail you a copy immediately. diff --git a/ext/phar/phar.c b/ext/phar/phar.c index c5042cc34..c85687ef5 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2579,6 +2579,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, php_serialize_data_t metadata_hash; smart_str main_metadata_str = {0}; int free_user_stub, free_fp = 1, free_ufp = 1; + int manifest_hack = 0; if (phar->is_persistent) { if (error) { @@ -2930,6 +2931,12 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, manifest_len = offset + phar->alias_len + sizeof(manifest) + main_metadata_str.len; phar_set_32(manifest, manifest_len); + /* Hack - see bug #65028, add padding byte to the end of the manifest */ + if(manifest[0] == '\r' || manifest[0] == '\n') { + manifest_len++; + phar_set_32(manifest, manifest_len); + manifest_hack = 1; + } phar_set_32(manifest+4, new_manifest_count); if (has_dirs) { *(manifest + 8) = (unsigned char) (((PHAR_API_VERSION) >> 8) & 0xFF); @@ -3054,6 +3061,22 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, return EOF; } } + /* Hack - see bug #65028, add padding byte to the end of the manifest */ + if(manifest_hack) { + if(1 != php_stream_write(newfile, manifest, 1)) { + if (closeoldfile) { + php_stream_close(oldfile); + } + + php_stream_close(newfile); + + if (error) { + spprintf(error, 0, "unable to write manifest padding byte"); + } + + return EOF; + } + } /* now copy the actual file data to the new phar */ offset = php_stream_tell(newfile); diff --git a/ext/phar/phar.phar.1.in b/ext/phar/phar.phar.1.in new file mode 100644 index 000000000..b5eecbfeb --- /dev/null +++ b/ext/phar/phar.phar.1.in @@ -0,0 +1 @@ +.so man1/phar.1 diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index a6dd2c814..aeb11851c 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1899,6 +1899,10 @@ PHP_METHOD(Phar, buildFromDirectory) pass.count = 0; pass.ret = return_value; pass.fp = php_stream_fopen_tmpfile(); + if (pass.fp == NULL) { + zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" unable to create temporary file", phar_obj->arc.archive->fname); + return; + } if (phar_obj->arc.archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->arc.archive) TSRMLS_CC)) { zval_ptr_dtor(&iteriter); @@ -1979,6 +1983,10 @@ PHP_METHOD(Phar, buildFromIterator) pass.ret = return_value; pass.count = 0; pass.fp = php_stream_fopen_tmpfile(); + if (pass.fp == NULL) { + zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\": unable to create temporary file", phar_obj->arc.archive->fname); + return; + } if (SUCCESS == spl_iterator_apply(obj, (spl_iterator_apply_func_t) phar_build, (void *) &pass TSRMLS_CC)) { phar_obj->arc.archive->ufp = pass.fp; @@ -2311,6 +2319,10 @@ static zval *phar_convert_to_other(phar_archive_data *source, int convert, char zend_get_hash_value, NULL, 0); phar->fp = php_stream_fopen_tmpfile(); + if (phar->fp == NULL) { + zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to create temporary file"); + return NULL; + } phar->fname = source->fname; phar->fname_len = source->fname_len; phar->is_temporary_alias = source->is_temporary_alias; diff --git a/ext/phar/tar.c b/ext/phar/tar.c index f17033543..0e60e3db1 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -847,7 +847,10 @@ int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error TS entry->is_modified = 1; entry->fp = php_stream_fopen_tmpfile(); entry->offset = entry->offset_abs = 0; - + if (entry->fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return -1; + } if (entry->metadata_str.len != php_stream_write(entry->fp, entry->metadata_str.c, entry->metadata_str.len)) { spprintf(error, 0, "phar tar error: unable to write metadata to magic metadata file \"%s\"", entry->filename); zend_hash_del(&(entry->phar->manifest), entry->filename, entry->filename_len); @@ -949,7 +952,10 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau entry.filename = estrndup(".phar/alias.txt", sizeof(".phar/alias.txt")-1); entry.filename_len = sizeof(".phar/alias.txt")-1; entry.fp = php_stream_fopen_tmpfile(); - + if (entry.fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return -1; + } if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) { if (error) { spprintf(error, 0, "unable to set alias in tar-based phar \"%s\"", phar->fname); @@ -1014,6 +1020,10 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau len = pos - user_stub + 18; entry.fp = php_stream_fopen_tmpfile(); + if (entry.fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return EOF; + } entry.uncompressed_filesize = len + 5; if ((size_t)len != php_stream_write(entry.fp, user_stub, len) @@ -1038,7 +1048,10 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau } else { /* Either this is a brand new phar (add the stub), or the default stub is required (overwrite the stub) */ entry.fp = php_stream_fopen_tmpfile(); - + if (entry.fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return EOF; + } if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { php_stream_close(entry.fp); if (error) { @@ -1087,7 +1100,6 @@ nostub: } newfile = php_stream_fopen_tmpfile(); - if (!newfile) { if (error) { spprintf(error, 0, "unable to create temporary file"); @@ -1174,7 +1186,10 @@ nostub: entry.filename = ".phar/signature.bin"; entry.filename_len = sizeof(".phar/signature.bin")-1; entry.fp = php_stream_fopen_tmpfile(); - + if (entry.fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return EOF; + } #ifdef WORDS_BIGENDIAN # define PHAR_SET_32(var, buffer) \ *(php_uint32 *)(var) = (((((unsigned char*)&(buffer))[3]) << 24) \ diff --git a/ext/phar/tests/bug65028.phpt b/ext/phar/tests/bug65028.phpt new file mode 100644 index 000000000..74273b850 --- /dev/null +++ b/ext/phar/tests/bug65028.phpt @@ -0,0 +1,156 @@ +--TEST-- +Phar - test specific manifest length +--INI-- +phar.readonly=0 +--SKIPIF-- +<?php if (!extension_loaded("phar")) die("skip"); ?> +--FILE-- +<?php + +$files = array( + "lib/widgets/Widgets.php", + "lib/events/FormBeginEventArgs.php", + "lib/events/FormEndEventArgs.php", + "lib/Core.php", + "lib/database/MySqlDatabase.php", + "lib/utils/DateUtil.php", + "js/global.js", + "files/_emptyDirectory", + "files/search/schema.xml", + "vendor/Fusonic/Linq/Internal/WhereIterator.php", + "vendor/Fusonic/Linq/Internal/SelectManyIterator.php", + "vendor/Fusonic/Linq/Internal/SelectIterator.php", + "vendor/Fusonic/Linq/Internal/DiffIterator.php", + "vendor/Fusonic/Linq/Internal/GroupIterator.php", + "vendor/Fusonic/Linq/Internal/DistinctIterator.php", + "vendor/Fusonic/Linq/Internal/LinqHelper.php", + "vendor/Fusonic/Linq/Internal/OrderIterator.php", + "vendor/Fusonic/Linq/Internal/IntersectIterator.php", + "vendor/Fusonic/Linq/GroupedLinq.php", + "vendor/Fusonic/Linq.php", + "vendor/Fusonic/UI/Widgets/Forms/FormBegin.php", + "vendor/Fusonic/UI/Widgets/Forms/FormSectionBuilder.php", + "vendor/Fusonic/UI/Widgets/Forms/AutoSelect.php", + "vendor/Fusonic/UI/Widgets/Forms/ControlGroup.php", + "vendor/Fusonic/UI/Widgets/Forms/FormEnd.php", + "vendor/Fusonic/UI/Widgets/WidgetBase.php", + "modules/calendar/ajax/calendarGetInvitedUsersContentAjaxHandler.php", + "modules/calendar/js/calendarAppointmentForm.js", + "modules/calendar/misc/calendarAppointment.php", + "modules/calendar/pages/forms/calendarAppointmentForm.php", + "modules/calendar/setup/config.xml", + "modules/cmt/js/cmtMicroCommentsWidget.js", + "modules/cmt/setup/config.xml", + "modules/meta/misc/metaContentHelper.php", + "modules/meta/setup/config.xml", + "modules/brd/misc/brdPostStreamFormatter.php", + "modules/brd/misc/brdPost.php", + "modules/brd/setup/config/streamContents.xml", + "modules/brd/setup/resources/lang/en.xml", + "modules/brd/setup/resources/lang/de.xml", + "modules/brd/setup/config.xml", + "modules/auth/misc/authLoginService.php", + "modules/auth/setup/config.xml", + "modules/bwd/cache/bwdWordCacheCreator.php", + "modules/bwd/bwd.php", + "modules/bwd/setup/config.xml", + "modules/nws/templates/pages/forms/nwsNewsForm.tpl", + "modules/nws/templates/pages/nwsShowNewsPage.tpl", + "modules/nws/pages/forms/nwsNewsForm.php", + "modules/nws/pages/nwsShowNewsPage.php", + "modules/nws/setup/config.xml", + "modules/gmp/cache/gmpMarkersCacheCreator.php", + "modules/gmp/select/gmpMapContentSelect.php", + "modules/gmp/templates/gmpShowAppointmentPage.tpl", + "modules/gmp/templates/gmpShowLinkPage.tpl", + "modules/gmp/setup/config.xml", + "modules/mul/cache/mulVideoPortalCacheCreator.php", + "modules/mul/misc/mulPermissionHelper.php", + "modules/mul/templates/widgets/mulFileEmbedWidget_Video_Flv.tpl", + "modules/mul/setup/config/mulUploadVideoPortalMatches.xml", + "modules/mul/setup/config.xml", + "modules/cat/select/catCategorySelect.php", + "modules/cat/misc/catCategory.php", + "modules/cat/templates/pages/forms/catCategoryForm.tpl", + "modules/cat/pages/forms/catEditCategoryForm.php", + "modules/cat/pages/forms/catAddCategoryForm.php", + "modules/cat/setup/config.xml", + "modules/sty/events/styPageShowEventHandler.php", + "modules/sty/misc/styBox.php", + "modules/sty/templates/pages/forms/styLayoutForm.tpl", + "modules/sty/templates/pages/forms/styBoxForm.tpl", + "modules/sty/templates/pages/forms/styVariantForm.tpl", + "modules/sty/setup/resources/lang/en.xml", + "modules/sty/setup/resources/lang/de.xml", + "modules/sty/setup/config.xml", + "modules/reg/misc/regRegistrationHelper.php", + "modules/reg/setup/config.xml", + "modules/not/misc/notEmailNotificationProvider.php", + "modules/not/setup/config.xml", + "modules/styfusonic/setup/config.xml", + "modules/sys/ajax/sysUserAutoSuggestSelectAjaxHandler.php", + "modules/sys/js/sysUserAutoSuggestSelect.js", + "modules/sys/select/sysPermissionSelect.php", + "modules/sys/misc/sysHtaccessConfigWriter.php", + "modules/sys/misc/sysUserRepository.php", + "modules/sys/setup/resources/lang/en.xml", + "modules/sys/setup/resources/lang/de.xml", + "modules/sys/setup/config.xml", + "modules/igr/boxes/igrGreatestEntriesBoxTab.php", + "modules/igr/boxes/igrTopRatedEntriesBoxTab.php", + "modules/igr/setup/config.xml", + "modules/rat/ajax/ratRateAjaxHandler.php", + "modules/rat/ajax/ratUnlikeAjaxHandler.php", + "modules/rat/setup/config.xml", + "modules/search/select/searchModuleSelect.php", + "modules/search/select/searchOrderSelect.php", + "modules/search/misc/searchResultFormatter.php", + "modules/search/misc/searchProviderSolr.php", + "modules/search/misc/searchProviderLucene.php", + "modules/search/misc/searchResultItem.php", + "modules/search/misc/searchProviderBase.php", + "modules/search/misc/searchIProvider.php", + "modules/search/templates/misc/searchResultFormatter.tpl", + "modules/search/templates/pages/searchIndexPage.tpl", + "modules/search/templates/pages/forms/searchSearchForm.tpl", + "modules/search/pages/forms/searchSearchForm.php", + "modules/search/css/searchResultFormatter.css", + "modules/search/setup/config/sysSettings.xml", + "modules/search/setup/resources/lang/en.xml", + "modules/search/setup/resources/lang/de.xml", + "modules/search/setup/config.xml", + "style/Fusonic/40components.css", + "style/_emptyDirectory", + "index.php", +// "a", // This will make the test pass +); + +// Create Phar with the filenames above +$phar = new Phar(__DIR__ . "/bug65028.phar"); +foreach($files as $file) +{ + $phar->addFromString($file, ""); +} + +// Copy phar +copy(__DIR__ . "/bug65028.phar", __DIR__ . "/bug65028-copy.phar"); + +// Open phar +try +{ + $phar = new Phar(__DIR__ . "/bug65028-copy.phar"); + echo "No exception thrown.\n"; +} +catch(UnexpectedValueException $ex) +{ + echo "Exception thrown: " . $ex->getMessage() . "\n"; +} +?> +--CLEAN-- +<?php +@unlink(__DIR__ . "/bug65028.phar"); +@unlink(__DIR__ . "/bug65028-copy.phar"); +?> +--EXPECT-- +No exception thrown. + diff --git a/ext/phar/tests/files/openssl.cnf b/ext/phar/tests/files/openssl.cnf index 10e69076c..4ed40fdc8 100644 --- a/ext/phar/tests/files/openssl.cnf +++ b/ext/phar/tests/files/openssl.cnf @@ -3,7 +3,7 @@ default_bits = 1024 default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes -x509_extensions = v3_ca # The extentions to add to the self signed cert +x509_extensions = v3_ca # The extensions to add to the self signed cert string_mask = MASK:4294967295 diff --git a/ext/phar/util.c b/ext/phar/util.c index 05c90cd45..898d8bd4b 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -889,6 +889,10 @@ int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **er dest->offset = 0; dest->is_modified = 1; dest->fp = php_stream_fopen_tmpfile(); + if (dest->fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return EOF; + } phar_seek_efp(source, 0, SEEK_SET, 0, 1 TSRMLS_CC); link = phar_get_link_source(source TSRMLS_CC); @@ -1129,6 +1133,10 @@ int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{ } fp = php_stream_fopen_tmpfile(); + if (fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return FAILURE; + } phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC); link = phar_get_link_source(entry TSRMLS_CC); diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 33732fbd6..6ba745e9c 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -937,10 +937,11 @@ is_compressed: PHAR_SET_32(local.uncompsize, entry->uncompressed_filesize); PHAR_SET_32(central.compsize, entry->compressed_filesize); PHAR_SET_32(local.compsize, entry->compressed_filesize); - - if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) { - spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname); - return ZEND_HASH_APPLY_STOP; + if (p->old) { + if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) { + spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname); + return ZEND_HASH_APPLY_STOP; + } } } not_compressed: @@ -1095,6 +1096,10 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas off_t tell, st; newfile = php_stream_fopen_tmpfile(); + if (newfile == NULL) { + spprintf(pass->error, 0, "phar error: unable to create temporary file for the signature file"); + return FAILURE; + } st = tell = php_stream_tell(pass->filefp); /* copy the local files, central directory, and the zip comment to generate the hash */ php_stream_seek(pass->filefp, 0, SEEK_SET); @@ -1122,6 +1127,10 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas entry.fp = php_stream_fopen_tmpfile(); entry.fp_type = PHAR_MOD; entry.is_modified = 1; + if (entry.fp == NULL) { + spprintf(pass->error, 0, "phar error: unable to create temporary file for signature"); + return FAILURE; + } PHAR_SET_32(sigbuf, phar->sig_flags); PHAR_SET_32(sigbuf + 4, signature_length); @@ -1192,7 +1201,10 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau /* set alias */ if (!phar->is_temporary_alias && phar->alias_len) { entry.fp = php_stream_fopen_tmpfile(); - + if (entry.fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return EOF; + } if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) { if (error) { spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname); @@ -1267,6 +1279,10 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau len = pos - user_stub + 18; entry.fp = php_stream_fopen_tmpfile(); + if (entry.fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return EOF; + } entry.uncompressed_filesize = len + 5; if ((size_t)len != php_stream_write(entry.fp, user_stub, len) @@ -1300,7 +1316,10 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau } else { /* Either this is a brand new phar (add the stub), or the default stub is required (overwrite the stub) */ entry.fp = php_stream_fopen_tmpfile(); - + if (entry.fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return EOF; + } if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { php_stream_close(entry.fp); if (error) { diff --git a/ext/posix/config.m4 b/ext/posix/config.m4 index 83ead2e46..82b80ce97 100644 --- a/ext/posix/config.m4 +++ b/ext/posix/config.m4 @@ -45,6 +45,6 @@ int main(int argc, char *argv[]) ]) ]) if test "$ac_cv_have_utsname_domainname" = yes; then - AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Wether struct utsname has domainname]) + AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Whether struct utsname has domainname]) fi fi diff --git a/ext/posix/tests/posix_ctermid.phpt b/ext/posix/tests/posix_ctermid.phpt index f77da00aa..551ed7304 100644 --- a/ext/posix/tests/posix_ctermid.phpt +++ b/ext/posix/tests/posix_ctermid.phpt @@ -13,7 +13,7 @@ PHP Testfest Berlin 2009-05-10 } // needed because of #ifdef HAVE_CTERMID in posix.c if (!function_exists('posix_ctermid')) { - die('SKIP - Fuction posix_ctermid() not available'); + die('SKIP - Function posix_ctermid() not available'); } ?> --FILE-- diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 3148f80db..bd460696b 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -259,6 +259,7 @@ PHP_FUNCTION(readline_info) #endif add_assoc_string(return_value,"library_version",(char *)SAFE_STRING(rl_library_version),1); add_assoc_string(return_value,"readline_name",(char *)SAFE_STRING(rl_readline_name),1); + add_assoc_long(return_value,"attempted_completion_over",rl_attempted_completion_over); } else { if (!strcasecmp(what,"line_buffer")) { oldstr = rl_line_buffer; @@ -313,7 +314,14 @@ PHP_FUNCTION(readline_info) rl_readline_name = strdup(Z_STRVAL_PP(value));; } RETVAL_STRING(SAFE_STRING(oldstr),1); - } + } else if (!strcasecmp(what, "attempted_completion_over")) { + oldval = rl_attempted_completion_over; + if (value) { + convert_to_long_ex(value); + rl_attempted_completion_over = Z_LVAL_PP(value); + } + RETVAL_LONG(oldval); + } } } diff --git a/ext/readline/tests/readline_callback_handler_install_001.phpt b/ext/readline/tests/readline_callback_handler_install_001.phpt index 8bf1d61e4..c88a4e86f 100644 --- a/ext/readline/tests/readline_callback_handler_install_001.phpt +++ b/ext/readline/tests/readline_callback_handler_install_001.phpt @@ -15,7 +15,7 @@ var_dump(readline_callback_handler_install('testing: ')); ?> --EXPECTF-- -testing: bool(true) +%Atesting: bool(true) Warning: readline_callback_handler_install(): foobar! is not callable in %s on line %d bool(false) diff --git a/ext/readline/tests/readline_callback_handler_remove_001.phpt b/ext/readline/tests/readline_callback_handler_remove_001.phpt index 768041a4c..83b592e05 100644 --- a/ext/readline/tests/readline_callback_handler_remove_001.phpt +++ b/ext/readline/tests/readline_callback_handler_remove_001.phpt @@ -13,8 +13,8 @@ var_dump(readline_callback_handler_install('testing: ', 'foo')); var_dump(readline_callback_handler_remove()); ?> ---EXPECT-- +--EXPECTF-- bool(false) -testing: bool(true) +%Atesting: bool(true) testing: bool(true) bool(true) diff --git a/ext/readline/tests/readline_info_001.phpt b/ext/readline/tests/readline_info_001.phpt index c7bc92a4d..ebab3bf68 100644 --- a/ext/readline/tests/readline_info_001.phpt +++ b/ext/readline/tests/readline_info_001.phpt @@ -12,10 +12,12 @@ var_dump(readline_info('line_buffer')); var_dump(readline_info('readline_name')); var_dump(readline_info('readline_name', 1)); var_dump(readline_info('readline_name')); +var_dump(readline_info('attempted_completion_over',1)); +var_dump(readline_info('attempted_completion_over')); ?> --EXPECTF-- -array(10) { +array(11) { ["line_buffer"]=> string(0) "" ["point"]=> @@ -36,6 +38,8 @@ array(10) { string(%d) "%s" ["readline_name"]=> string(5) "other" + ["attempted_completion_over"]=> + int(0) } NULL NULL @@ -43,3 +47,5 @@ string(0) "" string(5) "other" string(5) "other" string(1) "1" +int(0) +int(1) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 6c4d80623..c4a7c554f 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -5237,7 +5237,7 @@ ZEND_METHOD(reflection_extension, getVersion) /* }}} */ /* {{{ proto public ReflectionFunction[] ReflectionExtension::getFunctions() - Returns an array of this extension's fuctions */ + Returns an array of this extension's functions */ ZEND_METHOD(reflection_extension, getFunctions) { reflection_object *intern; diff --git a/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt b/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt index 465e868cf..dfec951f7 100644 --- a/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt +++ b/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -ReflectionExtension::getClassNames() method on an extension which acually returns some information +ReflectionExtension::getClassNames() method on an extension which actually returns some information --CREDITS-- Felix De Vliegher <felix.devliegher@gmail.com> --FILE-- diff --git a/ext/reflection/tests/bug64936.inc b/ext/reflection/tests/bug64936.inc new file mode 100644 index 000000000..8ba8c8966 --- /dev/null +++ b/ext/reflection/tests/bug64936.inc @@ -0,0 +1,5 @@ +<?php + +class B { + +} diff --git a/ext/reflection/tests/bug64936.phpt b/ext/reflection/tests/bug64936.phpt new file mode 100644 index 000000000..363a17f50 --- /dev/null +++ b/ext/reflection/tests/bug64936.phpt @@ -0,0 +1,38 @@ +--TEST-- +ReflectionMethod::getDocComment() uses left over doc comment from previous scanner run +--INI-- +opcache.save_comments=1 +opcache.load_comments=1 +--SKIPIF-- +<?php +if (!extension_loaded('reflection') || !extension_loaded('tokenizer')) print 'skip missing reflection of tokernizer extension'; +?> +--FILE-- +<?php + +function strip_doc_comment($c) +{ + if (!strlen($c) || $c === false) return $c; + return trim(substr($c, 3, -2)); +} + +token_get_all("<?php\n/**\n * Foo\n */"); // doc_comment compiler global now contains this Foo comment + +eval('class A { }'); // Could also be an include of a file containing similar + +$ra = new ReflectionClass('A'); +var_dump(strip_doc_comment($ra->getDocComment())); + +token_get_all("<?php\n/**\n * Foo\n */"); // doc_comment compiler global now contains this Foo comment + +include('bug64936.inc'); + +$rb = new ReflectionClass('B'); +var_dump(strip_doc_comment($rb->getDocComment())); + +?> +===DONE=== +--EXPECT-- +bool(false) +bool(false) +===DONE=== diff --git a/ext/session/mod_files.sh b/ext/session/mod_files.sh index 1d2672847..4fc4f20f7 100644 --- a/ext/session/mod_files.sh +++ b/ext/session/mod_files.sh @@ -1,24 +1,65 @@ #! /bin/sh -if test "$2" = ""; then - echo "usage: $0 basedir depth" - exit 1 +if [[ "$2" = "" ]] || [[ "$3" = "" ]]; then + echo "Usage: $0 BASE_DIRECTORY DEPTH HASH_BITS" + echo "BASE_DIRECTORY will be created if it doesn't exist" + echo "DEPTH must be an integer number >0" + echo "HASH_BITS(session.hash_bits_per_charactor) should be one of 4, 5, or 6" + exit 1 fi -if test "$2" = "0"; then - exit 0 +if [[ "$2" = "0" ]] && [[ ! "$4" = "recurse" ]]; then + echo "Can't create a directory tree with depth of 0, exiting." fi +if [[ "$2" = "0" ]]; then + exit 0 +fi + +directory="$1" +depth="$2" +hashbits="$3" + hash_chars="0 1 2 3 4 5 6 7 8 9 a b c d e f" -if test "$3" -a "$3" -ge "5"; then - hash_chars="$hash_chars g h i j k l m n o p q r s t u v" - if test "$3" -eq "6"; then - hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ," - fi + +if [[ "$hashbits" -ge "5" ]]; then + hash_chars="$hash_chars g h i j k l m n o p q r s t u v" fi +if [[ "$hashbits" -ge "6" ]]; then + hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ," +fi + +while [[ -d $directory ]] && [[ $( ls $directory ) ]]; do + echo "Directory $directory is not empty! What would you like to do?" + + options="\"Delete directory contents\" \"Choose another directory\" \"Quit\"" + eval set $options + select opt in "$@"; do + + if [[ $opt = "Delete directory contents" ]]; then + echo "Deleting $directory contents... " + rm -rf $directory/* + elif [[ $opt = "Choose another directory" ]]; then + echo "Which directory would you like to choose?" + read directory + elif [[ $opt = "Quit" ]]; then + exit 0 + fi + + break; + done +done + +if [[ ! -d $directory ]]; then + mkdir -p $directory +fi + + +echo "Creating session path in $directory with a depth of $depth for session.hash_bits_per_character = $hashbits" + for i in $hash_chars; do - newpath="$1/$i" - mkdir $newpath || exit 1 - sh $0 $newpath `expr $2 - 1` $3 + newpath="$directory/$i" + mkdir $newpath || exit 1 + sh $0 $newpath `expr $depth - 1` $hashbits recurse done diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c index e5406d0bc..e0d16d192 100644 --- a/ext/session/mod_mm.c +++ b/ext/session/mod_mm.c @@ -271,6 +271,8 @@ PHP_MINIT_FUNCTION(ps_mm) } if (!(euid_len = slprintf(euid, sizeof(euid), "%d", geteuid()))) { + free(ps_mm_instance); + ps_mm_instance = NULL; return FAILURE; } diff --git a/ext/session/session.c b/ext/session/session.c index a3be9a78c..e699cb9b5 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -281,7 +281,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */ PHP_MD5_CTX md5_context; PHP_SHA1_CTX sha1_context; #if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH) - void *hash_context; + void *hash_context = NULL; #endif unsigned char *digest; int digest_len; @@ -341,7 +341,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */ unsigned char rbuf[2048]; size_t toread = PS(entropy_length); - if (php_win32_get_random_bytes(rbuf, (size_t) toread) == SUCCESS){ + if (php_win32_get_random_bytes(rbuf, MIN(toread, sizeof(rbuf))) == SUCCESS){ switch (PS(hash_func)) { case PS_HASH_FUNC_MD5: @@ -615,6 +615,31 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */ } /* }}} */ +static PHP_INI_MH(OnUpdateName) /* {{{ */ +{ + /* Numeric session.name won't work at all */ + if (PG(modules_activated) && + (!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) { + int err_type; + + if (stage == ZEND_INI_STAGE_RUNTIME) { + err_type = E_WARNING; + } else { + err_type = E_ERROR; + } + + /* Do not output error when restoring ini options. */ + if (stage != ZEND_INI_STAGE_DEACTIVATE) { + php_error_docref(NULL TSRMLS_CC, err_type, "session.name cannot be a numeric or empty '%s'", new_value); + } + return FAILURE; + } + + OnUpdateStringUnempty(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + return SUCCESS; +} +/* }}} */ + static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */ { long val; @@ -706,9 +731,9 @@ static ZEND_INI_MH(OnUpdateSmartStr) /* {{{ */ */ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("session.save_path", "", PHP_INI_ALL, OnUpdateSaveDir,save_path, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateString, session_name, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateName, session_name, php_ps_globals, ps_globals) PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateSaveHandler) - STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_ALL, OnUpdateBool, auto_start, php_ps_globals, ps_globals) + STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_PERDIR, OnUpdateBool, auto_start, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.gc_probability", "1", PHP_INI_ALL, OnUpdateLong, gc_probability, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.gc_divisor", "100", PHP_INI_ALL, OnUpdateLong, gc_divisor, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, OnUpdateLong, gc_maxlifetime, php_ps_globals, ps_globals) @@ -1027,7 +1052,7 @@ static inline void strcpy_gmt(char *ubuf, time_t *when) /* {{{ */ res = php_gmtime_r(when, &tm); if (!res) { - buf[0] = '\0'; + ubuf[0] = '\0'; return; } @@ -2221,6 +2246,12 @@ static PHP_MSHUTDOWN_FUNCTION(session) /* {{{ */ PHP_MSHUTDOWN(ps_mm) (SHUTDOWN_FUNC_ARGS_PASSTHRU); #endif + /* reset rfc1867 callbacks */ + php_session_rfc1867_orig_callback = NULL; + if (php_rfc1867_callback == php_session_rfc1867_callback) { + php_rfc1867_callback = NULL; + } + ps_serializers[PREDEFINED_SERIALIZERS].name = NULL; memset(&ps_modules[PREDEFINED_MODULES], 0, (MAX_MODULES-PREDEFINED_MODULES)*sizeof(ps_module *)); @@ -2363,7 +2394,7 @@ static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, i php_session_initialize(TSRMLS_C); PS(session_status) = php_session_active; IF_SESSION_VARS() { - progress->cancel_upload = php_check_cancel_upload(progress TSRMLS_CC); + progress->cancel_upload |= php_check_cancel_upload(progress TSRMLS_CC); ZEND_SET_SYMBOL_WITH_LENGTH(Z_ARRVAL_P(PS(http_session_vars)), progress->key.c, progress->key.len+1, progress->data, 2, 0); } php_session_flush(TSRMLS_C); diff --git a/ext/session/tests/020.phpt b/ext/session/tests/020.phpt index f43bac5d1..014112982 100644 --- a/ext/session/tests/020.phpt +++ b/ext/session/tests/020.phpt @@ -1,5 +1,5 @@ --TEST-- -rewriter uses arg_seperator.output for modifying URLs +rewriter uses arg_separator.output for modifying URLs --SKIPIF-- <?php include('skipif.inc'); ?> --INI-- diff --git a/ext/session/tests/bug50308.phpt b/ext/session/tests/bug50308.phpt new file mode 100644 index 000000000..110277ce3 --- /dev/null +++ b/ext/session/tests/bug50308.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #50308 (session id not appended properly for empty anchor tags) +--SKIPIF-- +<?php include('skipif.inc'); ?> +--INI-- +session.name=PHPSESSID +session.save_handler=files +session.use_trans_sid=1 +session.use_only_cookies=0 +--FILE-- +<?php +@session_start(); +?> +<a href=""/> +<a href="" /> +<a href="foo"/> +<a href="foo" /> +<a href=foo/> +<a href=/> +<a href=?foo=bar/> +<a href="?foo=bar"/> +--EXPECTF-- +<a href="?PHPSESSID=%s"/> +<a href="?PHPSESSID=%s" /> +<a href="foo?PHPSESSID=%s"/> +<a href="foo?PHPSESSID=%s" /> +<a href=foo/?PHPSESSID=%s> +<a href=/?PHPSESSID=%s> +<a href=?foo=bar/&PHPSESSID=%s> +<a href="?foo=bar&PHPSESSID=%s"/> diff --git a/ext/session/tests/session_name_error.phpt b/ext/session/tests/session_name_error.phpt index 2ed10d92a..1b99d4ea3 100644 --- a/ext/session/tests/session_name_error.phpt +++ b/ext/session/tests/session_name_error.phpt @@ -86,7 +86,7 @@ $inputs = array( $iterator = 1; foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; - var_dump(session_name($input)); + var_dump($input, session_name($input)); $iterator++; }; @@ -98,77 +98,139 @@ ob_end_flush(); *** Testing session_name() : error functionality *** -- Iteration 1 -- + +Warning: session_name(): session.name cannot be a numeric or empty '0' in %s on line %d +int(0) string(9) "PHPSESSID" -- Iteration 2 -- -string(1) "0" + +Warning: session_name(): session.name cannot be a numeric or empty '1' in %s on line %d +int(1) +string(9) "PHPSESSID" -- Iteration 3 -- -string(1) "1" + +Warning: session_name(): session.name cannot be a numeric or empty '12345' in %s on line %d +int(12345) +string(9) "PHPSESSID" -- Iteration 4 -- -string(5) "12345" + +Warning: session_name(): session.name cannot be a numeric or empty '-2345' in %s on line %d +int(-2345) +string(9) "PHPSESSID" -- Iteration 5 -- -string(5) "-2345" + +Warning: session_name(): session.name cannot be a numeric or empty '10.5' in %s on line %d +float(10.5) +string(9) "PHPSESSID" -- Iteration 6 -- -string(4) "10.5" + +Warning: session_name(): session.name cannot be a numeric or empty '-10.5' in %s on line %d +float(-10.5) +string(9) "PHPSESSID" -- Iteration 7 -- -string(5) "-10.5" + +Warning: session_name(): session.name cannot be a numeric or empty '123456789000' in %s on line %d +float(123456789000) +string(9) "PHPSESSID" -- Iteration 8 -- -string(12) "123456789000" + +Warning: session_name(): session.name cannot be a numeric or empty '1.23456789E-9' in %s on line %d +float(1.23456789E-9) +string(9) "PHPSESSID" -- Iteration 9 -- -string(13) "1.23456789E-9" + +Warning: session_name(): session.name cannot be a numeric or empty '0.5' in %s on line %d +float(0.5) +string(9) "PHPSESSID" -- Iteration 10 -- -string(3) "0.5" + +Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d +NULL +string(9) "PHPSESSID" -- Iteration 11 -- -string(0) "" + +Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d +NULL +string(9) "PHPSESSID" -- Iteration 12 -- -string(0) "" + +Warning: session_name(): session.name cannot be a numeric or empty '1' in %s on line %d +bool(true) +string(9) "PHPSESSID" -- Iteration 13 -- -string(1) "1" + +Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d +bool(false) +string(9) "PHPSESSID" -- Iteration 14 -- -string(0) "" + +Warning: session_name(): session.name cannot be a numeric or empty '1' in %s on line %d +bool(true) +string(9) "PHPSESSID" -- Iteration 15 -- -string(1) "1" + +Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d +bool(false) +string(9) "PHPSESSID" -- Iteration 16 -- + +Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d string(0) "" +string(9) "PHPSESSID" -- Iteration 17 -- + +Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d string(0) "" +string(9) "PHPSESSID" -- Iteration 18 -- -string(0) "" +string(7) "Nothing" +string(9) "PHPSESSID" -- Iteration 19 -- string(7) "Nothing" +string(7) "Nothing" -- Iteration 20 -- +string(12) "Hello World!" string(7) "Nothing" -- Iteration 21 -- +object(classA)#1 (0) { +} string(12) "Hello World!" -- Iteration 22 -- + +Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d +NULL string(12) "Hello World!" -- Iteration 23 -- -string(0) "" + +Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d +NULL +string(12) "Hello World!" -- Iteration 24 -- Warning: session_name() expects parameter 1 to be string, resource given in %s on line %d +resource(5) of type (stream) NULL -Done - +Done
\ No newline at end of file diff --git a/ext/session/tests/session_name_variation1.phpt b/ext/session/tests/session_name_variation1.phpt index 16d6ad462..b0de3ee36 100644 --- a/ext/session/tests/session_name_variation1.phpt +++ b/ext/session/tests/session_name_variation1.phpt @@ -43,18 +43,20 @@ ob_end_flush(); *** Testing session_name() : variation *** string(9) "PHPSESSID" bool(true) -string(0) "" +string(9) "PHPSESSID" bool(true) -string(0) "" -string(0) "" +string(9) "PHPSESSID" +string(9) "PHPSESSID" bool(true) string(1) " " bool(true) string(1) " " + +Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d string(1) " " bool(true) -string(0) "" +string(1) " " bool(true) -string(0) "" +string(1) " " Done diff --git a/ext/session/tests/session_status_disabled.phpt b/ext/session/tests/session_status_disabled.phpt index 24e0ecd7b..c4d1f2192 100644 --- a/ext/session/tests/session_status_disabled.phpt +++ b/ext/session/tests/session_status_disabled.phpt @@ -3,7 +3,7 @@ Test session_status() function : disabled --SKIPIF-- <?php include('skipif.inc'); ?> --INI-- -session.save_handler=non-existant +session.save_handler=non-existent --FILE-- <?php diff --git a/ext/shmop/README b/ext/shmop/README index 5ec15861b..a8ea03af9 100644 --- a/ext/shmop/README +++ b/ext/shmop/README @@ -4,12 +4,12 @@ Shared Memory Operations Extension to PHP While developing a search deamon we needed a php based front end to communicate the deamon via SHM. PHP already had a shared memory - extention (sysvshm) written by Christian Cartus <cartus@atrior.de>, - unfortunatly this extention was designed with PHP only in mind and + extension (sysvshm) written by Christian Cartus <cartus@atrior.de>, + unfortunately this extension was designed with PHP only in mind and offers high level features which are extremly bothersome for basic SHM we had in mind. After spending a day trying to reverse engineer and figure out the format of sysvshm we decided that it would be much easier to - add our own extention to php for simple SHM operations, we were right :)). + add our own extension to php for simple SHM operations, we were right :)). the functions are: diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 692516840..2358f2be6 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1070,7 +1070,7 @@ static HashTable * sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{ int namelen; int test; char use_iter; - zval *iter_data; + zval *iter_data = NULL; use_iter = 0; diff --git a/ext/snmp/config.m4 b/ext/snmp/config.m4 index ccb7eea9a..9c0b82f77 100644 --- a/ext/snmp/config.m4 +++ b/ext/snmp/config.m4 @@ -59,67 +59,6 @@ if test "$PHP_SNMP" != "no"; then $SNMP_SHARED_LIBADD ]) - dnl Check for buggy snmp_snprint_value() (net-snmp BUGid 2027834) - AC_CACHE_CHECK([for buggy snmp_snprint_value], ac_cv_buggy_snprint_value,[ - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -I${SNMP_PREFIX}/include $SNMP_SHARED_LIBADD" - AC_TRY_RUN( [ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <net-snmp/net-snmp-config.h> -#include <net-snmp/net-snmp-includes.h> - -u_char uname[] = "Linux nex1.php.net 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:53:09 EST 2011 i686"; - -int main(int argc, char **argv) -{ - struct variable_list vars; - char buf1[2048]; - char buf2[sizeof(buf1)]; - - memset(&(buf1[0]), 0, sizeof(buf1)); - memset(&(buf2[0]), 0, sizeof(buf2)); - memset(&vars, 0, sizeof(vars)); - vars.type = 4; - vars.val.integer = (long *)&(uname[0]); - vars.val.string = &(uname[0]); - vars.val.bitstring = &(uname[0]); - vars.val.counter64 = (struct counter64 *)&(uname[0]); - vars.val.floatVal = (float *)&(uname[0]); - vars.val_len = sizeof(uname), - vars.name_loc[0] = 1; - vars.name_loc[1] = 3; - vars.name_loc[2] = 6; - vars.name_loc[3] = 1; - vars.name_loc[4] = 2; - vars.name_loc[5] = 1; - vars.name_loc[6] = 1; - vars.name_loc[7] = 1; - vars.name = (oid *)&(vars.name_loc); - vars.name_length = 9; - - init_snmp("snmpapp"); - - netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT, 0); - - snprint_value(buf1, (sizeof(uname) + 32), vars.name, vars.name_length, &vars); - snprint_value(buf2, sizeof(buf2), vars.name, vars.name_length, &vars); - exit((strncmp(buf1, buf2, sizeof(buf1)) != 0)); -} - ],[ - ac_cv_buggy_snprint_value=no - ],[ - ac_cv_buggy_snprint_value=yes - ],[ - ac_cv_buggy_snprint_value=no - ]) - CFLAGS="$save_CFLAGS" - ]) - if test "$ac_cv_buggy_snprint_value" = "yes"; then - AC_DEFINE(BUGGY_SNMPRINT_VALUE, 1, [ ]) - fi - PHP_NEW_EXTENSION(snmp, snmp.c, $ext_shared) PHP_SUBST(SNMP_SHARED_LIBADD) fi diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 0ae140f7d..93c2b21dd 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -514,7 +514,7 @@ static zend_object_value php_snmp_object_new(zend_class_entry *class_type TSRMLS static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, const char *format, ...) { va_list args; - php_snmp_object *snmp_object; + php_snmp_object *snmp_object = NULL; if (object) { snmp_object = (php_snmp_object *)zend_object_store_get_object(object TSRMLS_CC); @@ -551,35 +551,60 @@ static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_DC, int valueretrieval) { zval *val; -#ifdef BUGGY_SNMPRINT_VALUE - char sbuf[2048]; -#else - char sbuf[64]; -#endif + char sbuf[512]; char *buf = &(sbuf[0]); char *dbuf = (char *)NULL; int buflen = sizeof(sbuf) - 1; int val_len = vars->val_len; - if ((valueretrieval & SNMP_VALUE_PLAIN) == 0) { - val_len += 32; /* snprint_value will add type info into value, make some space for it */ + /* use emalloc() for large values, use static array otherwize */ + + /* There is no way to know the size of buffer snprint_value() needs in order to print a value there. + * So we are forced to probe it + */ + while ((valueretrieval & SNMP_VALUE_PLAIN) == 0) { + *buf = '\0'; + if (snprint_value(buf, buflen, vars->name, vars->name_length, vars) == -1) { + if (val_len > 512*1024) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "snprint_value() asks for a buffer more than 512k, Net-SNMP bug?"); + break; + } + /* buffer is not long enough to hold full output, double it */ + val_len *= 2; + } else { + break; + } + + if (buf == dbuf) { + dbuf = (char *)erealloc(dbuf, val_len + 1); + } else { + dbuf = (char *)emalloc(val_len + 1); + } + + if (!dbuf) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno)); + buf = &(sbuf[0]); + buflen = sizeof(sbuf) - 1; + break; + } + + buf = dbuf; + buflen = val_len; } - /* use emalloc() for large values, use static array otherwize */ - if(val_len > buflen){ + if((valueretrieval & SNMP_VALUE_PLAIN) && val_len > buflen){ if ((dbuf = (char *)emalloc(val_len + 1))) { buf = dbuf; buflen = val_len; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed: %s, fallback to static array", strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno)); } } - *buf = 0; - MAKE_STD_ZVAL(val); if (valueretrieval & SNMP_VALUE_PLAIN) { + *buf = 0; switch (vars->type) { case ASN_BIT_STR: /* 0x03, asn1.h */ ZVAL_STRINGL(val, (char *)vars->val.bitstring, vars->val_len, 1); @@ -652,7 +677,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D break; } } else /* use Net-SNMP value translation */ { - snprint_value(buf, buflen, vars->name, vars->name_length, vars); + /* we have desired string in buffer, just use it */ ZVAL_STRING(val, buf, 1); } @@ -694,7 +719,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, zval *snmpval = NULL; int snmp_errno; - /* we start with retval=FALSE. If any actual data is aquired, retval will be set to appropriate type */ + /* we start with retval=FALSE. If any actual data is acquired, retval will be set to appropriate type */ RETVAL_FALSE; /* reset errno and errstr */ @@ -1162,9 +1187,10 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char continue; } if ((*res)->sa_family == AF_INET6) { - strcpy(session->peername, "udp6:"); + strcpy(session->peername, "udp6:["); pptr = session->peername + strlen(session->peername); inet_ntop((*res)->sa_family, &(((struct sockaddr_in6*)(*res))->sin6_addr), pptr, MAX_NAME_LEN); + strcat(pptr, "]"); } else if ((*res)->sa_family == AF_INET) { inet_ntop((*res)->sa_family, &(((struct sockaddr_in*)(*res))->sin_addr), pptr, MAX_NAME_LEN); } else { @@ -1845,7 +1871,7 @@ PHP_METHOD(snmp, close) /* }}} */ /* {{{ proto mixed SNMP::get(mixed object_id [, bool preserve_keys]) - Fetch a SNMP object returing scalar for single OID and array of oid->value pairs for multi OID request */ + Fetch a SNMP object returning scalar for single OID and array of oid->value pairs for multi OID request */ PHP_METHOD(snmp, get) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET, (-1)); @@ -1853,7 +1879,7 @@ PHP_METHOD(snmp, get) /* }}} */ /* {{{ proto mixed SNMP::getnext(mixed object_id) - Fetch a SNMP object returing scalar for single OID and array of oid->value pairs for multi OID request */ + Fetch a SNMP object returning scalar for single OID and array of oid->value pairs for multi OID request */ PHP_METHOD(snmp, getnext) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GETNEXT, (-1)); diff --git a/ext/snmp/tests/README b/ext/snmp/tests/README index 819a50d8a..0db1a4f82 100644 --- a/ext/snmp/tests/README +++ b/ext/snmp/tests/README @@ -35,6 +35,8 @@ On Linux/FreeBSD Before launching daemon make sure that there is no file /var/net-snmp/snmpd.conf Delete it if exists. Ingoring to to so will fail SNMPv3 tests. +- Place bigtest.sh near snmpd.conf, tune path to it in snmpd.conf + - Launch snmpd (service snmpd start or /etc/init.d/snmpd start). Alternatively you can start snmpd daemon using following command line: sudo snmpd -C -c ./snmpd.conf -f -Le diff --git a/ext/snmp/tests/bigtest.sh b/ext/snmp/tests/bigtest.sh new file mode 100755 index 000000000..d0d8be783 --- /dev/null +++ b/ext/snmp/tests/bigtest.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +Q=""; +i=0; +while [ $i -lt 32 ]; do + Q="${Q}\3\2\4\11\22\13\14\15\16\17\20\21\22\23\24\25\26\27"; + i=$((i+1)); +done + +printf "${Q}" diff --git a/ext/snmp/tests/bug64159.phpt b/ext/snmp/tests/bug64159.phpt new file mode 100644 index 000000000..52e53c957 --- /dev/null +++ b/ext/snmp/tests/bug64159.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #64159: Truncated snmpget +--CREDITS-- +Boris Lytochkin +--SKIPIF-- +<?php +require_once(dirname(__FILE__).'/skipif.inc'); +?> +--ENV-- +MIBS=noneXistent +--FILE-- +<?php +require_once(dirname(__FILE__).'/snmp_include.inc'); + +snmp_set_quick_print(false); +snmp_set_valueretrieval(SNMP_VALUE_LIBRARY); + +var_dump(("ab8283f948419b2d24d22f44a80b17d3" === md5(snmpget($hostname, $community, '.1.3.6.1.4.1.2021.8.1.101.1')))); + +?> +--EXPECTF-- +MIB search path: %s +Cannot find module (noneXistent): At line %d in (%s) +bool(true) diff --git a/ext/snmp/tests/snmp-object.phpt b/ext/snmp/tests/snmp-object.phpt index 522d417af..40567dae9 100644 --- a/ext/snmp/tests/snmp-object.phpt +++ b/ext/snmp/tests/snmp-object.phpt @@ -90,12 +90,6 @@ array_shift($z); var_dump(key($z)); array_shift($z); var_dump(key($z)); -array_shift($z); -var_dump(key($z)); -array_shift($z); -var_dump(key($z)); -array_shift($z); -var_dump(key($z)); var_dump($session->close()); echo "SNMPv3 (default security settings)\n"; @@ -211,9 +205,6 @@ string(3) "2.0" string(3) "3.0" string(3) "4.0" string(3) "5.0" -string(3) "6.0" -string(3) "7.0" -string(3) "8.0" bool(true) SNMPv3 (default security settings) string(%d) "%S" diff --git a/ext/snmp/tests/snmpd.conf b/ext/snmp/tests/snmpd.conf index 3e9137294..5297d0b9e 100644 --- a/ext/snmp/tests/snmpd.conf +++ b/ext/snmp/tests/snmpd.conf @@ -23,3 +23,5 @@ createUser adminMD5DES MD5 test1234 DES test1234 createUser noAuthUser authuser read noAuthUser noauth + +exec HexTest /bin/sh /etc/snmp/bigtest.sh diff --git a/ext/soap/TODO b/ext/soap/TODO index ad0b11c94..9e6784f6f 100644 --- a/ext/soap/TODO +++ b/ext/soap/TODO @@ -41,7 +41,7 @@ Encoding ? support for "nillable" and "nil" ? default values of <element> ? provide schema 1999/2001 support??? -? make internal refrences for soap encoding (use seralization logic)??? +? make internal references for soap encoding (use serialization logic)??? ? provide user space overriding of serialization certin objects and types??? WSDL diff --git a/ext/soap/TODO.old b/ext/soap/TODO.old index 59deb4b9d..b219c61f8 100644 --- a/ext/soap/TODO.old +++ b/ext/soap/TODO.old @@ -2,13 +2,13 @@ TODO: make sure soap 1.1 and 1.2 is supported fully Better WSDL support Client and server (how much validation is needed here?) UDDI?? -make internal refrences for soap encoding (use seralization logic) +make internal references for soap encoding (use serialization logic) add ini option for always soap_error_handler provide user space overriding of serialization certin objects and types serialization in general needs to be polished/finished... all xsd types look to see if php-soap will work with out always_populate_raw_post_data on see if client will work with ssl.. should be eaiser with php_streams -work on soap seralizer (php serialization) +work on soap serializer (php serialization) -work on a soap-service 'regiestry' and 'proxy' (apache soap style) -convert all string mainpulation to use smart_str make the 'soap' packet abstract.. maybe incorperate xml-rpc diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php index 5b978734e..b8ee893d8 100644 --- a/ext/soap/interop/client_round2_interop.php +++ b/ext/soap/interop/client_round2_interop.php @@ -300,7 +300,7 @@ class Interop_Client /** * decodeSoapval - * decodes a soap value to php type, used for test result comparisions + * decodes a soap value to php type, used for test result comparisons * * @param SOAP_Value soapval * @return mixed result @@ -398,7 +398,7 @@ class Interop_Client $namespace = $soapaction = 'http://soapinterop.org/'; // hack to make tests work with MS SoapToolkit // it's the only one that uses this soapaction, and breaks if - // it isn't right. Can't wait for soapaction to be fully depricated + // it isn't right. Can't wait for soapaction to be fully deprecated if ($this->currentTest == 'base' && strstr($endpoint_info['endpointName'],'MS SOAP ToolKit 2.0')) { $soapaction = 'urn:soapinterop'; diff --git a/ext/soap/interop/client_round2_params.php b/ext/soap/interop/client_round2_params.php index f0987a170..e0b2c0e82 100644 --- a/ext/soap/interop/client_round2_params.php +++ b/ext/soap/interop/client_round2_params.php @@ -486,7 +486,7 @@ $test->headers_expect = array(); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint header destination, must understand, -// invalid namespace, should recieve a fault +// invalid namespace, should receive a fault $test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL); $test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT); $test->headers_expect = array(); diff --git a/ext/soap/interop/index.php b/ext/soap/interop/index.php index 1ae25d92f..fc12bc8cb 100644 --- a/ext/soap/interop/index.php +++ b/ext/soap/interop/index.php @@ -35,7 +35,7 @@ classes to define what the type of the value is.</p> <h3>Client Test Interface</h3> <p>The <a href="client_round2.php">client interface</a> allows you to run the PHP SOAP -Client against a choosen interop server. Each run updates the results database below.</p> +Client against a chosen interop server. Each run updates the results database below.</p> <h3>Interop Client Test Results</h3> <p>This is a database of the current test results using PHP SOAP Clients against interop servers.</p> diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index d83b85e63..7fc755d51 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -1160,7 +1160,7 @@ try_again: zval *err; MAKE_STD_ZVAL(err); ZVAL_STRINGL(err, http_body, http_body_size, 1); - add_soap_fault(this_ptr, "HTTP", "Didn't recieve an xml document", NULL, err TSRMLS_CC); + add_soap_fault(this_ptr, "HTTP", "Didn't receive an xml document", NULL, err TSRMLS_CC); efree(content_type); efree(http_headers); efree(http_body); diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index 7d2e12974..25bb17727 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -1081,6 +1081,14 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp nsptr = xmlSearchNs(groupType->doc, groupType, BAD_CAST(ns)); if (nsptr != NULL) { smart_str_appends(&key, (char*)nsptr->href); + } else { + xmlAttrPtr ns = get_attribute(groupType->properties, "targetNamespace"); + if (ns == NULL) { + ns = tns; + } + if (ns) { + smart_str_appends(&key, (char*)ns->children->content); + } } smart_str_appendc(&key, ':'); smart_str_appends(&key, type); @@ -1509,6 +1517,14 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp if (nsptr != NULL) { smart_str_appends(&nscat, (char*)nsptr->href); newType->namens = estrdup((char*)nsptr->href); + } else { + xmlAttrPtr ns = get_attribute(attrs, "targetNamespace"); + if (ns == NULL) { + ns = tns; + } + if (ns) { + smart_str_appends(&nscat, (char*)ns->children->content); + } } smart_str_appendc(&nscat, ':'); smart_str_appends(&nscat, type); @@ -1735,6 +1751,14 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl if (nsptr != NULL) { smart_str_appends(&key, (char*)nsptr->href); newAttr->namens = estrdup((char*)nsptr->href); + } else { + xmlAttrPtr ns = get_attribute(attrType->properties, "targetNamespace"); + if (ns == NULL) { + ns = tns; + } + if (ns) { + smart_str_appends(&key, (char*)ns->children->content); + } } smart_str_appendc(&key, ':'); smart_str_appends(&key, attr_name); @@ -2036,13 +2060,31 @@ static void copy_extra_attribute(void *attribute) } } +static void* schema_find_by_ref(HashTable *ht, char *ref) +{ + void **tmp; + + if (zend_hash_find(ht, ref, strlen(ref)+1, (void**)&tmp) == SUCCESS) { + return tmp; + } else { + ref = strrchr(ref, ':'); + if (ref) { + if (zend_hash_find(ht, ref, strlen(ref)+1, (void**)&tmp) == SUCCESS) { + return tmp; + } + } + } + return NULL; +} + static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr) { sdlAttributePtr *tmp; if (attr->ref != NULL) { if (ctx->attributes != NULL) { - if (zend_hash_find(ctx->attributes, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) { + tmp = (sdlAttributePtr*)schema_find_by_ref(ctx->attributes, attr->ref); + if (tmp) { schema_attribute_fixup(ctx, *tmp); if ((*tmp)->name != NULL && attr->name == NULL) { attr->name = estrdup((*tmp)->name); @@ -2092,7 +2134,8 @@ static void schema_attributegroup_fixup(sdlCtx *ctx, sdlAttributePtr attr, HashT if (attr->ref != NULL) { if (ctx->attributeGroups != NULL) { - if (zend_hash_find(ctx->attributeGroups, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) { + tmp = (sdlTypePtr*)schema_find_by_ref(ctx->attributeGroups, attr->ref); + if (tmp) { if ((*tmp)->attributes) { zend_hash_internal_pointer_reset((*tmp)->attributes); while (zend_hash_get_current_data((*tmp)->attributes,(void**)&tmp_attr) == SUCCESS) { @@ -2149,7 +2192,7 @@ static void schema_content_model_fixup(sdlCtx *ctx, sdlContentModelPtr model) model->kind = XSD_CONTENT_GROUP; model->u.group = (*tmp); } else { - soap_error0(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute"); + soap_error1(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute '%s'", model->u.group_ref); } break; } @@ -2193,7 +2236,8 @@ static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type) if (type->ref != NULL) { if (ctx->sdl->elements != NULL) { - if (zend_hash_find(ctx->sdl->elements, type->ref, strlen(type->ref)+1, (void**)&tmp) == SUCCESS) { + tmp = (sdlTypePtr*)schema_find_by_ref(ctx->sdl->elements, type->ref); + if (tmp) { type->kind = (*tmp)->kind; type->encode = (*tmp)->encode; if ((*tmp)->nillable) { @@ -2209,7 +2253,7 @@ static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type) } else if (strcmp(type->ref, SCHEMA_NAMESPACE ":schema") == 0) { type->encode = get_conversion(XSD_ANYXML); } else { - soap_error0(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute"); + soap_error1(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute '%s'", type->ref); } } efree(type->ref); diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 33e137cbb..0ac4c2ed7 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -40,8 +40,8 @@ static void delete_binding(void *binding); static void delete_binding_persistent(void *binding); static void delete_function(void *function); static void delete_function_persistent(void *function); -static void delete_parameter(void *paramater); -static void delete_parameter_persistent(void *paramater); +static void delete_parameter(void *parameter); +static void delete_parameter_persistent(void *parameter); static void delete_header(void *header); static void delete_header_persistent(void *header); static void delete_document(void *doc_ptr); diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 7df84e5b2..9371df6fb 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1284,7 +1284,7 @@ PHP_METHOD(SoapServer, setClass) } } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set a non existant class (%s)", classname); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set a non existent class (%s)", classname); return; } @@ -1415,7 +1415,7 @@ PHP_METHOD(SoapServer, addFunction) zend_str_tolower_copy(key, Z_STRVAL_PP(tmp_function), key_len); if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existant function '%s'", Z_STRVAL_PP(tmp_function)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_PP(tmp_function)); return; } @@ -1437,7 +1437,7 @@ PHP_METHOD(SoapServer, addFunction) zend_str_tolower_copy(key, Z_STRVAL_P(function_name), key_len); if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existant function '%s'", Z_STRVAL_P(function_name)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(function_name)); return; } if (service->soap_functions.ft == NULL) { @@ -1669,7 +1669,7 @@ PHP_METHOD(SoapServer, handle) } } #endif - /* If new session or something wierd happned */ + /* If new session or something weird happned */ if (soap_obj == NULL) { zval *tmp_soap; @@ -3658,7 +3658,44 @@ ignore_header: return function; } -static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main TSRMLS_DC) +static void set_soap_header_attributes(xmlNodePtr h, HashTable *ht, int version) +{ + zval **tmp; + + if (zend_hash_find(ht, "mustUnderstand", sizeof("mustUnderstand"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_BOOL && Z_LVAL_PP(tmp)) { + if (version == SOAP_1_1) { + xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("1")); + } else { + xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("true")); + } + } + if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) { + if (Z_TYPE_PP(tmp) == IS_STRING) { + if (version == SOAP_1_1) { + xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(Z_STRVAL_PP(tmp))); + } else { + xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(Z_STRVAL_PP(tmp))); + } + } else if (Z_TYPE_PP(tmp) == IS_LONG) { + if (version == SOAP_1_1) { + if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { + xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(SOAP_1_1_ACTOR_NEXT)); + } + } else { + if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { + xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NEXT)); + } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NONE) { + xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NONE)); + } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_UNLIMATERECEIVER) { + xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_UNLIMATERECEIVER)); + } + } + } + } +} + +static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main, xmlNodePtr *node TSRMLS_DC) { xmlNodePtr method = NULL, param; sdlParamPtr parameter = NULL; @@ -3758,6 +3795,9 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch if (use == SOAP_ENCODED && version == SOAP_1_2 && method != NULL) { xmlSetNsProp(method, body->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE)); } + if (node) { + *node = method; + } return use; } @@ -3839,7 +3879,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function } if (headers->function) { - if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0 TSRMLS_CC) == SOAP_ENCODED) { + if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0, NULL TSRMLS_CC) == SOAP_ENCODED) { use = SOAP_ENCODED; } } else { @@ -3909,7 +3949,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function if (version == SOAP_1_1) { if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) { - int new_len; + size_t new_len; xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode")); char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); xmlAddChild(param, node); @@ -3919,7 +3959,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function xmlNodeSetContent(node, code); xmlFree(code); } else { - xmlNodeSetContentLen(node, BAD_CAST(str), new_len); + xmlNodeSetContentLen(node, BAD_CAST(str), (int)new_len); } efree(str); } @@ -3934,7 +3974,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function detail_name = "detail"; } else { if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) { - int new_len; + size_t new_len; xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Code"), NULL); char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); node = xmlNewChild(node, ns, BAD_CAST("Value"), NULL); @@ -3944,7 +3984,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function xmlNodeSetContent(node, code); xmlFree(code); } else { - xmlNodeSetContentLen(node, BAD_CAST(str), new_len); + xmlNodeSetContentLen(node, BAD_CAST(str), (int)new_len); } efree(str); } @@ -4025,15 +4065,15 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function zval *hdr_ret = &h->retval; char *hdr_ns = h->hdr?h->hdr->ns:NULL; char *hdr_name = Z_STRVAL(h->function_name); - + HashTable *ht = NULL; if (Z_TYPE(h->retval) == IS_OBJECT && instanceof_function(Z_OBJCE(h->retval), soap_header_class_entry TSRMLS_CC)) { - HashTable* ht = Z_OBJPROP(h->retval); zval **tmp; sdlSoapBindingFunctionHeaderPtr *hdr; smart_str key = {0}; + ht = Z_OBJPROP(h->retval); if (zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); @@ -4064,9 +4104,14 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function } if (h->function) { - if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0 TSRMLS_CC) == SOAP_ENCODED) { + xmlNodePtr xmlHdr = NULL; + + if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0, &xmlHdr TSRMLS_CC) == SOAP_ENCODED) { use = SOAP_ENCODED; } + if (ht) { + set_soap_header_attributes(xmlHdr, ht, version); + } } else { xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head TSRMLS_CC); if (hdr_name) { @@ -4076,6 +4121,9 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function xmlNsPtr nsptr = encode_add_ns(xmlHdr,hdr_ns); xmlSetNs(xmlHdr, nsptr); } + if (ht) { + set_soap_header_attributes(xmlHdr, ht, version); + } } } h = h->next; @@ -4089,7 +4137,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL); - if (serialize_response_call2(body, function, function_name, uri, ret, version, 1 TSRMLS_CC) == SOAP_ENCODED) { + if (serialize_response_call2(body, function, function_name, uri, ret, version, 1, NULL TSRMLS_CC) == SOAP_ENCODED) { use = SOAP_ENCODED; } @@ -4281,38 +4329,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function } nsptr = encode_add_ns(h, Z_STRVAL_PP(ns)); xmlSetNs(h, nsptr); - - if (zend_hash_find(ht, "mustUnderstand", sizeof("mustUnderstand"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_BOOL && Z_LVAL_PP(tmp)) { - if (version == SOAP_1_1) { - xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("1")); - } else { - xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("true")); - } - } - if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) { - if (Z_TYPE_PP(tmp) == IS_STRING) { - if (version == SOAP_1_1) { - xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(Z_STRVAL_PP(tmp))); - } else { - xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(Z_STRVAL_PP(tmp))); - } - } else if (Z_TYPE_PP(tmp) == IS_LONG) { - if (version == SOAP_1_1) { - if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { - xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(SOAP_1_1_ACTOR_NEXT)); - } - } else { - if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { - xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NEXT)); - } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NONE) { - xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NONE)); - } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_UNLIMATERECEIVER) { - xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_UNLIMATERECEIVER)); - } - } - } - } + set_soap_header_attributes(h, ht, version); } zend_hash_move_forward(soap_headers); } diff --git a/ext/soap/tests/bugs/bug27742.wsdl b/ext/soap/tests/bugs/bug27742.wsdl index f38d91185..7f1514acb 100644 --- a/ext/soap/tests/bugs/bug27742.wsdl +++ b/ext/soap/tests/bugs/bug27742.wsdl @@ -5,7 +5,7 @@ <xsd:schema targetNamespace="urn:TMSWebServices" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tms="urn:TMSWebServices" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<simpleType name="duration">
<annotation>
- <documentation xml:lang="en">ISO 8601 pattern used to denote program durations. Year, month and day are not relevent in our context and are omitted.</documentation>
+ <documentation xml:lang="en">ISO 8601 pattern used to denote program durations. Year, month and day are not relevant in our context and are omitted.</documentation>
</annotation>
<restriction base="xsd:duration">
<pattern value="PT[0-9][0-9]H[0-5][0-9]M"/>
@@ -484,7 +484,7 @@ </attribute>
<attribute name="to" type="tms:date" use="optional">
<annotation>
- <documentation xml:lang="en">Date untill which the mapping is valid, within the validity period of the whole XTVD document. @IMPORTANT : The change will occur at midnight.</documentation>
+ <documentation xml:lang="en">Date until which the mapping is valid, within the validity period of the whole XTVD document. @IMPORTANT : The change will occur at midnight.</documentation>
</annotation>
</attribute>
</complexType>
diff --git a/ext/soap/tests/bugs/bug28985.phpt b/ext/soap/tests/bugs/bug28985.phpt index 59d96e2c7..73ff899c3 100644 --- a/ext/soap/tests/bugs/bug28985.phpt +++ b/ext/soap/tests/bugs/bug28985.phpt @@ -44,10 +44,10 @@ array(42) { string iUserPassword; }" [8]=> - string(86) "struct MGCodeLibelle { + string(87) "struct MGCodeLibelle { string Code; string Libelle; - boolean Defaut; + boolean Default; anyType Tag; }" [9]=> @@ -203,4 +203,4 @@ array(42) { string(76) "struct GetEnvironnementResponse { MGEnvironnement GetEnvironnementResult; }" -}
\ No newline at end of file +} diff --git a/ext/soap/tests/bugs/bug28985.wsdl b/ext/soap/tests/bugs/bug28985.wsdl index ee528818b..50c2fcda8 100644 --- a/ext/soap/tests/bugs/bug28985.wsdl +++ b/ext/soap/tests/bugs/bug28985.wsdl @@ -67,7 +67,7 @@ type="s:string" /> type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Libelle"
type="s:string" />
- <s:element minOccurs="1" maxOccurs="1" name="Defaut"
+ <s:element minOccurs="1" maxOccurs="1" name="Default"
type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="Tag" />
</s:sequence>
diff --git a/ext/soap/tests/bugs/bug65018.phpt b/ext/soap/tests/bugs/bug65018.phpt new file mode 100644 index 000000000..bbb9b5e42 --- /dev/null +++ b/ext/soap/tests/bugs/bug65018.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #65018 (SoapHeader problems with SoapServer) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + class Tool{ + public function TOKEN($id){ + return new SoapHeader('namespace1', 'TOKEN', $id, true); + } + public function Method(){} + } + + $input = $input = + '<?xml version="1.0"?>'.PHP_EOL. + '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="namespace1"'. + ' xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'. + ' xmlns:xsd="http://www.w3.org/2001/XMLSchema">'. + '<SOAP-ENV:Header><ns1:TOKEN soapenv:mustUnderstand="1">abc</ns1:TOKEN></SOAP-ENV:Header>'. + '<SOAP-ENV:Body><ns1:Method /></SOAP-ENV:Body></SOAP-ENV:Envelope>'; + + $soap = new SoapServer(null, array('uri' => '127.0.0.1')); + $soap->setClass('Tool'); + $soap->handle($input); +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="namespace1" xmlns:ns2="127.0.0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:TOKEN SOAP-ENV:mustUnderstand="1">abc</ns1:TOKEN></SOAP-ENV:Header><SOAP-ENV:Body><ns2:MethodResponse><return xsi:nil="true"/></ns2:MethodResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 06bd0ec6b..d0d029464 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -352,7 +352,7 @@ const zend_function_entry sockets_functions[] = { PHP_FE(socket_clear_error, arginfo_socket_clear_error) PHP_FE(socket_import_stream, arginfo_socket_import_stream) - /* for downwards compatability */ + /* for downwards compatibility */ PHP_FALIAS(socket_getopt, socket_get_option, arginfo_socket_get_option) PHP_FALIAS(socket_setopt, socket_set_option, arginfo_socket_set_option) @@ -843,6 +843,9 @@ PHP_MINIT_FUNCTION(sockets) REGISTER_LONG_CONSTANT("SO_RCVTIMEO", SO_RCVTIMEO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SO_TYPE", SO_TYPE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SO_ERROR", SO_ERROR, CONST_CS | CONST_PERSISTENT); +#ifdef SO_BINDTODEVICE + REGISTER_LONG_CONSTANT("SO_BINDTODEVICE", SO_BINDTODEVICE, CONST_CS | CONST_PERSISTENT); +#endif REGISTER_LONG_CONSTANT("SOL_SOCKET", SOL_SOCKET, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SOMAXCONN", SOMAXCONN, CONST_CS | CONST_PERSISTENT); #ifdef TCP_NODELAY @@ -1822,8 +1825,8 @@ PHP_FUNCTION(socket_recvfrom) retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&s_un, (socklen_t *)&slen); if (retval < 0) { - efree(recv_buf); PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); + efree(recv_buf); RETURN_FALSE; } @@ -1847,8 +1850,8 @@ PHP_FUNCTION(socket_recvfrom) retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&sin, (socklen_t *)&slen); if (retval < 0) { - efree(recv_buf); PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); + efree(recv_buf); RETURN_FALSE; } @@ -1876,8 +1879,8 @@ PHP_FUNCTION(socket_recvfrom) retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&sin6, (socklen_t *)&slen); if (retval < 0) { - efree(recv_buf); PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); + efree(recv_buf); RETURN_FALSE; } @@ -2355,7 +2358,19 @@ ipv6_loop_hops: #endif break; } - +#ifdef SO_BINDTODEVICE + case SO_BINDTODEVICE: { + if (Z_TYPE_PP(arg4) == IS_STRING) { + opt_ptr = Z_STRVAL_PP(arg4); + optlen = Z_STRLEN_PP(arg4); + } else { + opt_ptr = ""; + optlen = 0; + } + break; + } +#endif + default: convert_to_long_ex(arg4); ov = Z_LVAL_PP(arg4); diff --git a/ext/sockets/tests/socket_set_option_bindtodevice.phpt b/ext/sockets/tests/socket_set_option_bindtodevice.phpt new file mode 100644 index 000000000..05d718ce6 --- /dev/null +++ b/ext/sockets/tests/socket_set_option_bindtodevice.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test if socket_set_option() works, option:SO_BINDTODEVICE +--DESCRIPTION-- +-Bind to loopback 'lo' device (should exist) +-Bind to unexisting device +--SKIPIF-- +<?php +if (!extension_loaded('sockets')) { + die('SKIP sockets extension not available.'); +} +if (!defined("SO_BINDTODEVICE")) { + die('SKIP SO_BINDTODEVICE not supported on this platform.'); +} +if (!function_exists("posix_getuid") || posix_getuid() != 0) { + die('SKIP SO_BINDTODEVICE requires root permissions.'); +} +?> +--FILE-- +<?php +$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); + +if (!$socket) { + die('Unable to create AF_INET socket [socket]'); +} +// wrong params +$retval_1 = socket_set_option( $socket, SOL_SOCKET, SO_BINDTODEVICE, "lo"); +var_dump($retval_1); +$retval_2 = socket_set_option( $socket, SOL_SOCKET, SO_BINDTODEVICE, "ethIDONOTEXIST"); +var_dump($retval_2); + +socket_close($socket); +?> + +--EXPECTF-- +bool(true) + +Warning: socket_set_option(): unable to set socket option [19]: No such device in %s on line %d +bool(false) +--CREDITS-- +Damjan Cvetko, foreach.org diff --git a/ext/spl/internal/cachingiterator.inc b/ext/spl/internal/cachingiterator.inc index 33258ab95..4d4bf8dbf 100644 --- a/ext/spl/internal/cachingiterator.inc +++ b/ext/spl/internal/cachingiterator.inc @@ -23,7 +23,7 @@ * flag CALL_TOSTRING to do the conversion when the actual element * is being fetched. Otherwise the conversion would happen with the * already changed iterator. If you do not need this then it you should - * omit this flag because it costs unneccessary work and time. + * omit this flag because it costs unnecessary work and time. */ class CachingIterator implements OuterIterator { diff --git a/ext/spl/internal/iteratoriterator.inc b/ext/spl/internal/iteratoriterator.inc index 37676e053..451d05da3 100644 --- a/ext/spl/internal/iteratoriterator.inc +++ b/ext/spl/internal/iteratoriterator.inc @@ -17,7 +17,7 @@ * an Iterator. It is very important to understand that most classes that do * not implement Iterator have their reasone to. Most likely they do not allow * the full Iterator feature set. If so you need to provide techniques to - * prevent missuse. If you do not you must expect exceptions or fatal erros. + * prevent missuse. If you do not you must expect exceptions or fatal errors. * * It is also possible to derive the class and implement IteratorAggregate by * downcasting the instances returned in getIterator. See the following diff --git a/ext/spl/internal/multipleiterator.inc b/ext/spl/internal/multipleiterator.inc index 2ed71d53a..12df011ec 100644 --- a/ext/spl/internal/multipleiterator.inc +++ b/ext/spl/internal/multipleiterator.inc @@ -163,7 +163,7 @@ class MultipleIterator implements Iterator $retval = array(); foreach($this->iterators as $iter) { - if ($it->valid()) + if ($iter->valid()) { if ($this->flags & self::MIT_KEYS_ASSOC) { @@ -205,7 +205,7 @@ class MultipleIterator implements Iterator $retval = array(); foreach($this->iterators as $iter) { - if ($it->valid()) + if ($iter->valid()) { $retval[] = $iter->key(); } diff --git a/ext/spl/internal/splobjectstorage.inc b/ext/spl/internal/splobjectstorage.inc index fa164066c..ffc6c9948 100644 --- a/ext/spl/internal/splobjectstorage.inc +++ b/ext/spl/internal/splobjectstorage.inc @@ -16,7 +16,7 @@ * @since PHP 5.1.2 * * This container allows to store objects uniquly without the need to compare - * them one by one. This is only possible internally. The code represenation + * them one by one. This is only possible internally. The code representation * here therefore has a complexity of O(n) while the actual implementation has * complexity O(1). */ diff --git a/ext/spl/spl.php b/ext/spl/spl.php index fdffda368..3638a5a2b 100755 --- a/ext/spl/spl.php +++ b/ext/spl/spl.php @@ -260,7 +260,7 @@ class Exception /** The exception message */ protected $message; - /** The string represenations as generated during construction */ + /** The string representations as generated during construction */ private $string; /** The code passed to the constructor */ @@ -336,7 +336,7 @@ class Exception { } - /** @return string represenation of exception + /** @return string representation of exception */ public function __toString() { diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 2c2c87d02..552f67b18 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -166,7 +166,7 @@ zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, /* {{{ spl_array_object_new_ex */ static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, spl_array_object **obj, zval *orig, int clone_orig TSRMLS_DC) { - zend_object_value retval; + zend_object_value retval = {0}; spl_array_object *intern; zval *tmp; zend_class_entry * parent = class_type; @@ -1658,7 +1658,7 @@ SPL_METHOD(Array, getChildren) return; } if (instanceof_function(Z_OBJCE_PP(entry), Z_OBJCE_P(getThis()) TSRMLS_CC)) { - RETURN_ZVAL(*entry, 0, 0); + RETURN_ZVAL(*entry, 1, 0); } } @@ -1778,7 +1778,7 @@ SPL_METHOD(Array, unserialize) ++p; if (*p!='m') { - if (*p!='a' && *p!='O' && *p!='C') { + if (*p!='a' && *p!='O' && *p!='C' && *p!='r') { goto outexcept; } intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK; diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index f43a3709e..7f0ce631b 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -710,6 +710,12 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, long ctor_fla } intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + if (intern->_path) { + /* object is alreay initialized */ + zend_restore_error_handling(&error_handling TSRMLS_CC); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Directory object is already initialized"); + return; + } intern->flags = flags; #ifdef HAVE_GLOB if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_GLOB) && strstr(path, "glob://") != path) { @@ -1504,7 +1510,7 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren) Returns an iterator for the current entry if it is a directory */ SPL_METHOD(RecursiveDirectoryIterator, getChildren) { - zval zpath, zflags; + zval *zpath, *zflags; spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); spl_filesystem_object *subdir; char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH; @@ -1518,11 +1524,13 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren) if (SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) { RETURN_STRINGL(intern->file_name, intern->file_name_len, 1); } else { - INIT_PZVAL(&zflags); - INIT_PZVAL(&zpath); - ZVAL_LONG(&zflags, intern->flags); - ZVAL_STRINGL(&zpath, intern->file_name, intern->file_name_len, 0); - spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), &return_value, 0, &zpath, &zflags TSRMLS_CC); + MAKE_STD_ZVAL(zflags); + MAKE_STD_ZVAL(zpath); + ZVAL_LONG(zflags, intern->flags); + ZVAL_STRINGL(zpath, intern->file_name, intern->file_name_len, 1); + spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), &return_value, 0, zpath, zflags TSRMLS_CC); + zval_ptr_dtor(&zpath); + zval_ptr_dtor(&zflags); subdir = (spl_filesystem_object*)zend_object_store_get_object(return_value TSRMLS_CC); if (subdir) { diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index 215476a72..f7be97d4c 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -368,7 +368,7 @@ zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object static zend_object_value spl_dllist_object_new_ex(zend_class_entry *class_type, spl_dllist_object **obj, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */ { - zend_object_value retval; + zend_object_value retval = {0}; spl_dllist_object *intern; zend_class_entry *parent = class_type; int inherited = 0; diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index ebc4e341a..fec7e2c4a 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -604,6 +604,38 @@ SPL_METHOD(SplFixedArray, __construct) } /* }}} */ +/* {{{ proto void SplFixedArray::__wakeup() +*/ +SPL_METHOD(SplFixedArray, __wakeup) +{ + spl_fixedarray_object *intern = (spl_fixedarray_object *) zend_object_store_get_object(getThis() TSRMLS_CC); + HashPosition ptr; + HashTable *intern_ht = zend_std_get_properties(getThis() TSRMLS_CC); + zval **data; + + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")) { + return; + } + + if (!intern->array) { + int index = 0; + int size = zend_hash_num_elements(intern_ht); + + intern->array = emalloc(sizeof(spl_fixedarray)); + spl_fixedarray_init(intern->array, size TSRMLS_CC); + + for (zend_hash_internal_pointer_reset_ex(intern_ht, &ptr); zend_hash_get_current_data_ex(intern_ht, (void **) &data, &ptr) == SUCCESS; zend_hash_move_forward_ex(intern_ht, &ptr)) { + Z_ADDREF_PP(data); + intern->array->elements[index++] = *data; + } + + /* Remove the unserialised properties, since we now have the elements + * within the spl_fixedarray_object structure. */ + zend_hash_clean(intern_ht); + } +} +/* }}} */ + /* {{{ proto int SplFixedArray::count(void) */ SPL_METHOD(SplFixedArray, count) @@ -1086,6 +1118,7 @@ ZEND_END_ARG_INFO() static zend_function_entry spl_funcs_SplFixedArray[] = { /* {{{ */ SPL_ME(SplFixedArray, __construct, arginfo_splfixedarray_construct,ZEND_ACC_PUBLIC) + SPL_ME(SplFixedArray, __wakeup, arginfo_splfixedarray_void, ZEND_ACC_PUBLIC) SPL_ME(SplFixedArray, count, arginfo_splfixedarray_void, ZEND_ACC_PUBLIC) SPL_ME(SplFixedArray, toArray, arginfo_splfixedarray_void, ZEND_ACC_PUBLIC) SPL_ME(SplFixedArray, fromArray, arginfo_fixedarray_fromArray, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index e6cd155a8..eb8247654 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1027,12 +1027,12 @@ static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object * obje zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); if (data && *data) { RETVAL_ZVAL(*data, 1, 0); - } - if (Z_TYPE_P(return_value) == IS_ARRAY) { - zval_dtor(return_value); - ZVAL_STRINGL(return_value, "Array", sizeof("Array")-1, 1); - } else { - convert_to_string(return_value); + if (Z_TYPE_P(return_value) == IS_ARRAY) { + zval_dtor(return_value); + ZVAL_STRINGL(return_value, "Array", sizeof("Array")-1, 1); + } else { + convert_to_string(return_value); + } } zend_restore_error_handling(&error_handling TSRMLS_CC); } @@ -1133,8 +1133,15 @@ SPL_METHOD(RecursiveTreeIterator, current) } } + INIT_ZVAL(prefix); + INIT_ZVAL(entry); spl_recursive_tree_iterator_get_prefix(object, &prefix TSRMLS_CC); spl_recursive_tree_iterator_get_entry(object, &entry TSRMLS_CC); + if (Z_TYPE(entry) != IS_STRING) { + zval_dtor(&prefix); + zval_dtor(&entry); + RETURN_NULL(); + } spl_recursive_tree_iterator_get_postfix(object, &postfix TSRMLS_CC); str_len = Z_STRLEN(prefix) + Z_STRLEN(entry) + Z_STRLEN(postfix); diff --git a/ext/spl/tests/SplFileInfo_getInode_basic.phpt b/ext/spl/tests/SplFileInfo_getInode_basic.phpt index 902cbb31c..380b865cd 100644 --- a/ext/spl/tests/SplFileInfo_getInode_basic.phpt +++ b/ext/spl/tests/SplFileInfo_getInode_basic.phpt @@ -16,15 +16,15 @@ if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms <?php
//file -touch ('test_file_ptfi'); -$fileInfo = new SplFileInfo('test_file_ptfi'); -$result = shell_exec('ls -i test_file_ptfi'); +touch ('SplFileInfo_getInode_basic.txt'); +$fileInfo = new SplFileInfo('SplFileInfo_getInode_basic.txt'); +$result = shell_exec('ls -i SplFileInfo_getInode_basic.txt'); var_dump($fileInfo->getInode() == $result); ?> --CLEAN-- <?php -unlink('test_file_ptfi'); +unlink('SplFileInfo_getInode_basic.txt'); ?>
--EXPECTF--
bool(true) diff --git a/ext/spl/tests/SplFileInfo_getPerms_basic.phpt b/ext/spl/tests/SplFileInfo_getPerms_basic.phpt index e9b7beaa9..53591f341 100644 --- a/ext/spl/tests/SplFileInfo_getPerms_basic.phpt +++ b/ext/spl/tests/SplFileInfo_getPerms_basic.phpt @@ -16,15 +16,15 @@ if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms <?php
//file -touch ('test_file_ptfi'); -chmod('test_file_ptfi', 0557); -$fileInfo = new SplFileInfo('test_file_ptfi'); +touch ('SplFileInfo_getPerms_basic.txt'); +chmod('SplFileInfo_getPerms_basic.txt', 0557); +$fileInfo = new SplFileInfo('SplFileInfo_getPerms_basic.txt'); var_dump($fileInfo->getPerms() == 0100557); ?> --CLEAN-- <?php -unlink('test_file_ptfi'); +unlink('SplFileInfo_getPerms_basic.txt'); ?>
--EXPECTF--
bool(true) diff --git a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt index 32705f091..4402d6ca4 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -SplFileObject::fgetcsv with alternative delimeter +SplFileObject::fgetcsv with alternative delimiter --FILE-- <?php $fp = fopen('SplFileObject__fgetcsv.csv', 'w+'); diff --git a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt index 942c7619d..64d6514a2 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt @@ -1,5 +1,5 @@ --TEST-- -SplFileObject::fgetcsv with alternative delimeter +SplFileObject::fgetcsv with alternative delimiter --FILE-- <?php $fp = fopen('SplFileObject__fgetcsv.csv', 'w+'); diff --git a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt index ee2497252..efbb5fb68 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -SplFileObject::fgetcsv with alternative delimeter +SplFileObject::fgetcsv with alternative delimiter --FILE-- <?php $fp = fopen('SplFileObject__fgetcsv.csv', 'w+'); diff --git a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt index 5430e5375..7487b8353 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt @@ -1,5 +1,5 @@ --TEST-- -SplFileObject::fgetcsv with alternative delimeter +SplFileObject::fgetcsv with alternative delimiter --FILE-- <?php $fp = fopen('SplFileObject__fgetcsv.csv', 'w+'); diff --git a/ext/spl/tests/SplFileObject_fgetcsv_escape_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_escape_basic.phpt index 96c029095..1a94532b2 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_escape_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_escape_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -SplFileObject::fgetcsv with alternative delimeter +SplFileObject::fgetcsv with alternative delimiter --FILE-- <?php $fp = fopen('SplFileObject__fgetcsv.csv', 'w+'); diff --git a/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt index a57031899..fd90103bf 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt @@ -1,5 +1,5 @@ --TEST-- -SplFileObject::fgetcsv with alternative delimeter +SplFileObject::fgetcsv with alternative delimiter --FILE-- <?php $fp = fopen('SplFileObject__fgetcsv.csv', 'w+'); diff --git a/ext/spl/tests/SplFixedArray_serialize.phpt b/ext/spl/tests/SplFixedArray_serialize.phpt new file mode 100644 index 000000000..f99812ecc --- /dev/null +++ b/ext/spl/tests/SplFixedArray_serialize.phpt @@ -0,0 +1,52 @@ +--TEST-- +SplFixedArray serialisation +--FILE-- +<?php + +$array = new SplFixedArray(5); + +$obj = new stdClass; +$obj->prop = 'value'; + +$array[0] = 'foo'; +$array[2] = 42; +$array[3] = $obj; +$array[4] = range(1, 5); + +$ser = serialize($array); +echo "$ser\n"; +$unser = unserialize($ser); + +printf("count: %d\n", count($unser)); +printf("getSize(): %d\n", $unser->getSize()); + +var_dump($unser[0], $unser[1], $unser[2], $unser[3], $unser[4]); + +$unser[4] = 'quux'; +var_dump($unser[4]); + +?> +--EXPECT-- +O:13:"SplFixedArray":5:{i:0;s:3:"foo";i:1;N;i:2;i:42;i:3;O:8:"stdClass":1:{s:4:"prop";s:5:"value";}i:4;a:5:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;}} +count: 5 +getSize(): 5 +string(3) "foo" +NULL +int(42) +object(stdClass)#4 (1) { + ["prop"]=> + string(5) "value" +} +array(5) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) +} +string(4) "quux" diff --git a/ext/spl/tests/bug61828.phpt b/ext/spl/tests/bug61828.phpt new file mode 100644 index 000000000..04d435e6d --- /dev/null +++ b/ext/spl/tests/bug61828.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #61828 (Memleak when calling Directory(Recursive)Iterator/Spl(Temp)FileObject ctor twice) +--FILE-- +<?php +$x = new DirectoryIterator('.'); +$x->__construct('/tmp'); +echo "Okey"; +?> +--EXPECTF-- +Warning: DirectoryIterator::__construct(): Directory object is already initialized in %sbug61828.php on line 3 +Okey diff --git a/ext/spl/tests/bug62672.phpt b/ext/spl/tests/bug62672.phpt new file mode 100644 index 000000000..d0d6a6245 --- /dev/null +++ b/ext/spl/tests/bug62672.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #62672 (Error on serialize of ArrayObject) +--FILE-- +<?php + +class ObjA +{ + private $_varA; + + public function __construct(Iterator $source) + { + $this->_varA = $source; + } +} + +class ObjB extends ObjA +{ + private $_varB; + + public function __construct(ArrayObject $keys) + { + $this->_varB = $keys; + parent::__construct($keys->getIterator()); + } +} + +$obj = new ObjB(new ArrayObject()); + +var_dump($obj == unserialize(serialize($obj))); +--EXPECTF-- +bool(true) diff --git a/ext/spl/tests/bug63680.phpt b/ext/spl/tests/bug63680.phpt index 3a20c4bb1..0b5c35dc7 100644 --- a/ext/spl/tests/bug63680.phpt +++ b/ext/spl/tests/bug63680.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #63680 (Memleak in splfixedarray with cycle reference) +--INI-- +zend.enable_gc=1 --FILE-- <?php function dummy() { diff --git a/ext/spl/tests/bug65328.phpt b/ext/spl/tests/bug65328.phpt new file mode 100644 index 000000000..32e6c24fa --- /dev/null +++ b/ext/spl/tests/bug65328.phpt @@ -0,0 +1,348 @@ +--TEST-- +Bug #65328 (Segfault when getting SplStack object Value) +--FILE-- +<?php +/** + * @author AlexanderC + */ + +class Tree +{ + /** + * @var Node + */ + protected $head; + + /** + * @param Node $head + */ + public function __construct(Node $head = null) + { + $this->head = $head ? : new Node('HEAD'); + } + + /** + * @return Node + */ + public function getHead() + { + return $this->head; + } + + /** + * @param mixed $uid + * @return Node|bool + */ + public function find($uid) + { + $iterator = $this->getIterator(); + + /** @var Node $node */ + foreach($iterator as $node) { + if($node->getUid() === $uid) { + return $node; + } + } + + return false; + } + + /** + * @param mixed $uid + * @return \SplStack + */ + public function & findAll($uid) + { + $result = new \SplStack(); + + /** @var Node $node */ + foreach($this->getIterator() as $node) { + if($node->getUid() == $uid) { + $result->push($node); + } + } + + return $result; + } + + /** + * @return \RecursiveIteratorIterator + */ + public function getIterator() + { + return new \RecursiveIteratorIterator( + $this->head->getChildren(), + \RecursiveIteratorIterator::SELF_FIRST + ); + } +} + +class Node extends \RecursiveArrayIterator implements \Countable +{ + /** + * @var array + */ + protected $children = []; + + /** + * @var Node + */ + protected $parent; + + /** + * @var mixed + */ + protected $data; + + /** + * @var mixed + */ + protected $uid; + + /** + * @var int + */ + protected $index = 0; + + /** + * @var bool + */ + protected $assureUnique; + + /** + * @param mixed $data + * @param mixed $uid + * @param Node $parent + * @param bool $assureUnique + */ + public function __construct($data, $uid = null, Node $parent = null, $assureUnique = false) + { + if(null !== $parent) { + $this->parent = $parent; + } + + $this->data = $data; + $this->uid = $uid ? : uniqid(sha1(serialize($data)), true); + $this->assureUnique = $assureUnique; + } + + /** + * @param mixed $uid + */ + public function setUid($uid) + { + $this->uid = $uid; + } + + /** + * @return mixed + */ + public function getUid() + { + return $this->uid; + } + + /** + * @param Node $child + */ + public function addChild(Node $child) + { + $child->setParent($this); + $this->children[] = $child; + } + + /** + * @param array $children + */ + public function setChildren(array $children) + { + $this->children = $children; + } + + /** + * @return array + */ + public function getChildrenArray() + { + return $this->children; + } + + /** + * @param mixed $data + */ + public function setData($data) + { + $this->data = $data; + } + + /** + * @return mixed + */ + public function getData() + { + return $this->data; + } + + /** + * @param Node $parent + * @throws \RuntimeException + */ + public function setParent(Node $parent) + { + if(true === $this->assureUnique && !self::checkUnique($parent, $this->uid)) { + throw new \RuntimeException("Node uid is not unique in assigned node tree"); + } + + $this->parent = $parent; + } + + /** + * @param Node $node + * @param mixed $uid + * @return bool + */ + protected static function checkUnique(Node $node, $uid) + { + $headNode = $node; + do { + $headNode = $node; + } while($node = $node->getParent()); + + $tree = new Tree($headNode); + + return !$tree->find($uid); + } + + /** + * @return \IJsonRPC\Helpers\Tree\Node + */ + public function getParent() + { + return $this->parent; + } + + /** + * @return Node + */ + public function current() + { + return $this->children[$this->index]; + } + + /** + * @return scalar + */ + public function key() + { + return $this->index; + } + + /** + * @return void + */ + public function next() + { + ++$this->index; + } + + /** + * @return void + */ + public function rewind() + { + $this->index = 0; + } + + /** + * @return bool + */ + public function valid() + { + return array_key_exists($this->index, $this->children); + } + + /** + * @return int + */ + public function count() + { + return count($this->children); + } + + /** + * @return bool + */ + public function hasChildren() + { + return !empty($this->children); + } + + /** + * @return \RecursiveArrayIterator + */ + public function getChildren() + { + return new \RecursiveArrayIterator($this->children); + } +} + +$tree = new Tree(); +$node1 = new Node('value1', 1); +$tree->getHead()->addChild($node1); +$node2 = new Node('value2', 2); +$node1->addChild($node2); + +print_r($tree->findAll(2)->offsetGet(0)); +--EXPECTF-- +Node Object +( + [children:protected] => Array + ( + ) + + [parent:protected] => Node Object + ( + [children:protected] => Array + ( + [0] => Node Object + *RECURSION* + ) + + [parent:protected] => Node Object + ( + [children:protected] => Array + ( + [0] => Node Object + *RECURSION* + ) + + [parent:protected] => + [data:protected] => HEAD + [uid:protected] => %s + [index:protected] => 0 + [assureUnique:protected] => + [storage:ArrayIterator:private] => Array + ( + ) + + ) + + [data:protected] => value1 + [uid:protected] => 1 + [index:protected] => 1 + [assureUnique:protected] => + [storage:ArrayIterator:private] => Array + ( + ) + + ) + + [data:protected] => value2 + [uid:protected] => 2 + [index:protected] => 0 + [assureUnique:protected] => + [storage:ArrayIterator:private] => Array + ( + ) + +) diff --git a/ext/spl/tests/iterator_031.phpt b/ext/spl/tests/iterator_031.phpt index 40342f4bb..8bd3ca7c5 100644 --- a/ext/spl/tests/iterator_031.phpt +++ b/ext/spl/tests/iterator_031.phpt @@ -1,5 +1,5 @@ --TEST-- -SPL: AppendIterator::append() rewinds when neccessary +SPL: AppendIterator::append() rewinds when necessary --FILE-- <?php diff --git a/ext/spl/tests/spl_004.phpt b/ext/spl/tests/spl_004.phpt index 97896f815..d56f48f89 100644 --- a/ext/spl/tests/spl_004.phpt +++ b/ext/spl/tests/spl_004.phpt @@ -43,8 +43,8 @@ var_dump(iterator_apply($it, 'test')); echo "===ERRORS===\n"; var_dump(iterator_apply($it, 'test', 1)); -var_dump(iterator_apply($it, 'non_existing_functon')); -var_dump(iterator_apply($it, 'non_existing_functon', NULL, 2)); +var_dump(iterator_apply($it, 'non_existing_function')); +var_dump(iterator_apply($it, 'non_existing_function', NULL, 2)); ?> ===DONE=== @@ -77,7 +77,7 @@ int(4) Error: Argument 3 passed to iterator_apply() must be of the type array, integer given Error: iterator_apply() expects parameter 3 to be array, integer given NULL -Error: iterator_apply() expects parameter 2 to be a valid callback, function 'non_existing_functon' not found or invalid function name +Error: iterator_apply() expects parameter 2 to be a valid callback, function 'non_existing_function' not found or invalid function name NULL Error: iterator_apply() expects at most 3 parameters, 4 given NULL diff --git a/ext/spl/tests/spl_priorityqeue_insert_two_params_error.phpt b/ext/spl/tests/spl_priorityqeue_insert_two_params_error.phpt index 659ffb4bc..076c68771 100644 --- a/ext/spl/tests/spl_priorityqeue_insert_two_params_error.phpt +++ b/ext/spl/tests/spl_priorityqeue_insert_two_params_error.phpt @@ -1,5 +1,5 @@ --TEST-- -SPL: priorityQueue paramter test on insert method +SPL: priorityQueue parameter test on insert method --CREDITS-- Sean Burlington www.practicalweb.co.uk TestFest London May 2009 diff --git a/ext/sqlite3/libsqlite/sqlite3.c b/ext/sqlite3/libsqlite/sqlite3.c index d96367e21..3d71ebb18 100644 --- a/ext/sqlite3/libsqlite/sqlite3.c +++ b/ext/sqlite3/libsqlite/sqlite3.c @@ -361,7 +361,7 @@ ** The SQLITE_THREADSAFE macro must be defined as 0, 1, or 2. ** 0 means mutexes are permanently disable and the library is never ** threadsafe. 1 means the library is serialized which is the highest -** level of threadsafety. 2 means the libary is multithreaded - multiple +** level of threadsafety. 2 means the library is multithreaded - multiple ** threads can use SQLite as long as no two threads try to use the same ** database connection at the same time. ** @@ -11864,7 +11864,7 @@ SQLITE_PRIVATE int sqlite3MemdebugNoType(void*,u8); ** ************************************************************************* ** -** This file contains definitions of global variables and contants. +** This file contains definitions of global variables and constants. */ /* An array to map all upper-case characters into their corresponding @@ -12731,7 +12731,7 @@ struct VdbeFunc { */ struct sqlite3_context { FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ - VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */ + VdbeFunc *pVdbeFunc; /* Auxiliary data, if created. */ Mem s; /* The return value is stored here */ Mem *pMem; /* Memory cell used to store aggregate context */ int isError; /* Error code returned by the function. */ @@ -16130,7 +16130,7 @@ SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys3(void){ ** 1. All memory allocations sizes are rounded up to a power of 2. ** ** 2. If two adjacent free blocks are the halves of a larger block, -** then the two blocks are coalesed into the single larger block. +** then the two blocks are coalesced into the single larger block. ** ** 3. New memory is allocated from the first available free block. ** @@ -19267,7 +19267,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf( } if( xtype==etGENERIC && precision>0 ) precision--; #if 0 - /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */ + /* Rounding works like BSD when the constant 0.4999 is used. Weird! */ for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1); #else /* It makes more sense to use 0.5 */ @@ -20926,7 +20926,7 @@ do_atof_calc: /* store the result */ *pResult = result; - /* return true if number and no extra non-whitespace chracters after */ + /* return true if number and no extra non-whitespace characters after */ return z>=zEnd && nDigits>0 && eValid; #else return !sqlite3Atoi64(z, pResult, length, enc); @@ -23962,7 +23962,7 @@ static int os2Delete( } /* -** Check the existance and status of a file. +** Check the existence and status of a file. */ static int os2Access( sqlite3_vfs *pVfs, /* Not used on os2 */ @@ -26315,7 +26315,7 @@ static int nolockClose(sqlite3_file *id) { /****************************************************************************** ************************* Begin dot-file Locking ****************************** ** -** The dotfile locking implementation uses the existance of separate lock +** The dotfile locking implementation uses the existence of separate lock ** files in order to control access to the database. This works on just ** about every filesystem imaginable. But there are serious downsides: ** @@ -26330,7 +26330,7 @@ static int nolockClose(sqlite3_file *id) { ** ** Dotfile locking works by creating a file in the same directory as the ** database and with the same name but with a ".lock" extension added. -** The existance of a lock file implies an EXCLUSIVE lock. All other lock +** The existence of a lock file implies an EXCLUSIVE lock. All other lock ** types (SHARED, RESERVED, PENDING) are mapped into EXCLUSIVE. */ @@ -29637,7 +29637,7 @@ static int unixDelete( } /* -** Test the existance of or access permissions of file zPath. The +** Test the existence of or access permissions of file zPath. The ** test performed depends on the value of flags: ** ** SQLITE_ACCESS_EXISTS: Return 1 if the file exists @@ -30074,7 +30074,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** setting the environment variable SQLITE_FORCE_PROXY_LOCKING to 1 will ** force proxy locking to be used for every database file opened, and 0 ** will force automatic proxy locking to be disabled for all database -** files (explicity calling the SQLITE_SET_LOCKPROXYFILE pragma or +** files (explicitly calling the SQLITE_SET_LOCKPROXYFILE pragma or ** sqlite_file_control API is not affected by SQLITE_FORCE_PROXY_LOCKING). */ @@ -33788,7 +33788,7 @@ static int winDelete( } /* -** Check the existance and status of a file. +** Check the existence and status of a file. */ static int winAccess( sqlite3_vfs *pVfs, /* Not used on win32 */ @@ -34345,7 +34345,7 @@ SQLITE_API int sqlite3_os_end(void){ /* ** A bitmap is an instance of the following structure. ** -** This bitmap records the existance of zero or more bits +** This bitmap records the existence of zero or more bits ** with values between 1 and iSize, inclusive. ** ** There are three possible representations of the bitmap. @@ -35828,7 +35828,7 @@ static sqlite3_pcache *pcache1Create(int szPage, int bPurgeable){ int sz; /* Bytes of memory required to allocate the new cache */ /* - ** The seperateCache variable is true if each PCache has its own private + ** The separateCache variable is true if each PCache has its own private ** PGroup. In other words, separateCache is true for mode (1) where no ** mutexing is required. ** @@ -41734,7 +41734,7 @@ static void pagerUnlockIfUnused(Pager *pPager){ ** page is initialized to all zeros. ** ** If noContent is true, it means that we do not care about the contents -** of the page. This occurs in two seperate scenarios: +** of the page. This occurs in two separate scenarios: ** ** a) When reading a free-list leaf page from the database, and ** @@ -44929,7 +44929,7 @@ SQLITE_PRIVATE int sqlite3WalOpen( } /* -** Change the size to which the WAL file is trucated on each reset. +** Change the size to which the WAL file is truncated on each reset. */ SQLITE_PRIVATE void sqlite3WalLimit(Wal *pWal, i64 iLimit){ if( pWal ) pWal->mxWalSize = iLimit; @@ -48700,7 +48700,7 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){ }else if( gap+2<=top ){ /* Search the freelist looking for a free slot big enough to satisfy ** the request. The allocation is made from the first free slot in - ** the list that is large enough to accomadate it. + ** the list that is large enough to accommodate it. */ int pc, addr; for(addr=hdr+1; (pc = get2byte(&data[addr]))>0; addr=pc){ @@ -50520,7 +50520,7 @@ SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *p){ /* ** This routine is called prior to sqlite3PagerCommit when a transaction -** is commited for an auto-vacuum database. +** is committed for an auto-vacuum database. ** ** If SQLITE_OK is returned, then *pnTrunc is set to the number of pages ** the database file should be truncated to during the commit process. @@ -52264,7 +52264,7 @@ SQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){ ** which in turn can make database access faster. ** ** If the "exact" parameter is not 0, and the page-number nearby exists -** anywhere on the free-list, then it is guarenteed to be returned. This +** anywhere on the free-list, then it is guaranteed to be returned. This ** is only used by auto-vacuum databases when allocating a new table. */ static int allocateBtreePage( @@ -58372,7 +58372,7 @@ SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe *p, const char *zFormat, ...){ ** by running with Valgrind. ** ** About the #ifdef SQLITE_OMIT_TRACE: Normally, this routine is never called -** unless p->nOp>0. This is because in the absense of SQLITE_OMIT_TRACE, +** unless p->nOp>0. This is because in the absence of SQLITE_OMIT_TRACE, ** an OP_Trace instruction is always inserted by sqlite3VdbeGet() as soon as ** a new VDBE is created. So we are free to set addr to p->nOp-1 without ** having to double-check to make sure that the result is non-negative. But @@ -59355,7 +59355,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ /* The complex case - There is a multi-file write-transaction active. ** This requires a master journal file to ensure the transaction is - ** committed atomicly. + ** committed atomically. */ #ifndef SQLITE_OMIT_DISKIO else{ @@ -59551,7 +59551,7 @@ static void invalidateCursorsOnModifiedBtrees(sqlite3 *db){ ** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or ** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement ** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the -** statement transaction is commtted. +** statement transaction is committed. ** ** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned. ** Otherwise SQLITE_OK. @@ -60076,7 +60076,7 @@ SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor *p){ ** the blob of data that it corresponds to. In a table record, all serial ** types are stored at the start of the record, and the blobs of data at ** the end. Hence these functions allow the caller to handle the -** serial-type and data blob seperately. +** serial-type and data blob separately. ** ** The following table describes the various storage classes for data: ** @@ -61383,7 +61383,7 @@ SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){ } /* -** Return the auxilary data pointer, if any, for the iArg'th argument to +** Return the auxiliary data pointer, if any, for the iArg'th argument to ** the user-function defined by pCtx. */ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ @@ -61398,7 +61398,7 @@ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ } /* -** Set the auxilary data pointer and delete function, for the iArg'th +** Set the auxiliary data pointer and delete function, for the iArg'th ** argument to the user-function defined by pCtx. Any previous value is ** deleted by calling the delete function specified when it was set. */ @@ -63408,7 +63408,7 @@ SQLITE_PRIVATE int sqlite3VdbeExec( } #endif - /* On any opcode with the "out2-prerelase" tag, free any + /* On any opcode with the "out2-prerelease" tag, free any ** external allocations out of mem[p2] and set mem[p2] to be ** an undefined integer. Opcodes will either fill in the integer ** value or convert mem[p2] to a different type. @@ -65590,7 +65590,7 @@ case OP_AutoCommit: { ** other process can start another write transaction while this transaction is ** underway. Starting a write transaction also creates a rollback journal. A ** write transaction must be started before any changes can be made to the -** database. If P2 is 2 or greater then an EXCLUSIVE lock is also obtained +** database. If P2 is 2 or greater than an EXCLUSIVE lock is also obtained ** on the file. ** ** If a write-transaction is started and the Vdbe.usesStmtJournal flag is @@ -69899,7 +69899,7 @@ SQLITE_PRIVATE int sqlite3MemJournalSize(void){ /* ** Walk an expression tree. Invoke the callback once for each node -** of the expression, while decending. (In other words, the callback +** of the expression, while descending. (In other words, the callback ** is invoked before visiting children.) ** ** The return value from the callback should be one of the WRC_* @@ -70936,7 +70936,7 @@ static int resolveOrderGroupBy( } /* -** Resolve names in the SELECT statement p and all of its descendents. +** Resolve names in the SELECT statement p and all of its descendants. */ static int resolveSelectStep(Walker *pWalker, Select *p){ NameContext *pOuterNC; /* Context that contains this SELECT */ @@ -71244,7 +71244,7 @@ SQLITE_PRIVATE void sqlite3ResolveSelectNames( ** affinity of that column is returned. Otherwise, 0x00 is returned, ** indicating no affinity for the expression. ** -** i.e. the WHERE clause expresssions in the following statements all +** i.e. the WHERE clause expressions in the following statements all ** have an affinity: ** ** CREATE TABLE t1(a); @@ -72784,7 +72784,7 @@ SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ ** ** If rMayHaveNull is zero, that means that the subquery is being used ** for membership testing only. There is no need to initialize any -** registers to indicate the presense or absence of NULLs on the RHS. +** registers to indicate the presence or absence of NULLs on the RHS. ** ** For a SELECT or EXISTS operator, return the register that holds the ** result. For IN operators or if an error occurs, the return value is 0. @@ -74260,13 +74260,13 @@ static int evalConstExpr(Walker *pWalker, Expr *pExpr){ /* ** Preevaluate constant subexpressions within pExpr and store the -** results in registers. Modify pExpr so that the constant subexpresions +** results in registers. Modify pExpr so that the constant subexpressions ** are TK_REGISTER opcodes that refer to the precomputed values. ** ** This routine is a no-op if the jump to the cookie-check code has ** already occur. Since the cookie-check jump is generated prior to ** any other serious processing, this check ensures that there is no -** way to accidently bypass the constant initializations. +** way to accidentally bypass the constant initializations. ** ** This routine is also a no-op if the SQLITE_FactorOutConst optimization ** is disabled via the sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS) @@ -74392,7 +74392,7 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int int r1, r2; assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 ); - if( NEVER(v==0) ) return; /* Existance of VDBE checked by caller */ + if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */ if( NEVER(pExpr==0) ) return; /* No way this can happen */ op = pExpr->op; switch( op ){ @@ -74512,7 +74512,7 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int int r1, r2; assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 ); - if( NEVER(v==0) ) return; /* Existance of VDBE checked by caller */ + if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */ if( pExpr==0 ) return; /* The value of pExpr->op and op are related as follows: @@ -75132,7 +75132,7 @@ static void renameParentFunc( ** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER ** statement. The second is a table name. The table name in the CREATE ** TRIGGER statement is replaced with the third argument and the result -** returned. This is analagous to renameTableFunc() above, except for CREATE +** returned. This is analogous to renameTableFunc() above, except for CREATE ** TRIGGER, not CREATE INDEX and CREATE TABLE. */ static void renameTriggerFunc( @@ -79452,7 +79452,7 @@ SQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, /* Drop all SQLITE_MASTER table and index entries that refer to the ** table. The program name loops through the master table and deletes ** every row that refers to a table of the same name as the one being - ** dropped. Triggers are handled seperately because a trigger can be + ** dropped. Triggers are handled separately because a trigger can be ** created in the temp database that refers to a table in another ** database. */ @@ -82374,7 +82374,7 @@ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ ** ** If p1 is negative, then we begin abs(p1) from the end of x[]. ** -** If p2 is negative, return the p2 characters preceeding p1. +** If p2 is negative, return the p2 characters preceding p1. */ static void substrFunc( sqlite3_context *context, @@ -83172,7 +83172,7 @@ static void zeroblobFunc( /* ** The replace() function. Three arguments are all strings: call ** them A, B, and C. The result is also a string which is derived -** from A by replacing every occurance of B with C. The match +** from A by replacing every occurrence of B with C. The match ** must be exact. Collating sequences are not used. */ static void replaceFunc( @@ -86752,7 +86752,7 @@ static int xferOptimization( } #endif #ifndef SQLITE_OMIT_FOREIGN_KEY - /* Disallow the transfer optimization if the destination table constains + /* Disallow the transfer optimization if the destination table constrains ** any foreign key constraints. This is more restrictive than necessary. ** But the main beneficiary of the transfer optimization is the VACUUM ** command, and the VACUUM command disables foreign key constraints. So @@ -90574,7 +90574,7 @@ SQLITE_PRIVATE void sqlite3SelectDelete(sqlite3 *db, Select *p){ } /* -** Given 1 to 3 identifiers preceeding the JOIN keyword, determine the +** Given 1 to 3 identifiers preceding the JOIN keyword, determine the ** type of join. Return an integer constant that expresses that type ** in terms of the following bit values: ** @@ -91892,7 +91892,7 @@ static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){ /* ** "LIMIT -1" always shows all rows. There is some - ** contraversy about what the correct behavior should be. + ** controversy about what the correct behavior should be. ** The current implementation interprets "LIMIT 0" to mean ** no rows. */ @@ -93175,7 +93175,7 @@ static int flattenSubquery( pSubSrc = pSub->pSrc; assert( pSubSrc ); /* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants, - ** not arbitrary expresssions, we allowed some combining of LIMIT and OFFSET + ** not arbitrary expressions, we allowed some combining of LIMIT and OFFSET ** because they could be computed at compile-time. But when LIMIT and OFFSET ** became arbitrary expressions, we were forced to add restrictions (13) ** and (14). */ @@ -93544,7 +93544,7 @@ static u8 minMaxQuery(Select *p){ /* ** The select statement passed as the first argument is an aggregate query. -** The second argment is the associated aggregate-info object. This +** The second argument is the associated aggregate-info object. This ** function tests if the SELECT is of the form: ** ** SELECT count(*) FROM <tbl> @@ -93617,7 +93617,7 @@ SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pF ** without worrying about messing up the presistent representation ** of the view. ** -** (3) Add terms to the WHERE clause to accomodate the NATURAL keyword +** (3) Add terms to the WHERE clause to accommodate the NATURAL keyword ** on joins and the ON and USING clause of joins. ** ** (4) Scan the list of columns in the result set (pEList) looking @@ -94252,7 +94252,7 @@ SQLITE_PRIVATE int sqlite3Select( if( pSub==0 || pItem->isPopulated ) continue; /* Increment Parse.nHeight by the height of the largest expression - ** tree refered to by this, the parent select. The child select + ** tree referred to by this, the parent select. The child select ** may contain expression trees of at most ** (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit ** more conservative than necessary, but much easier than enforcing @@ -94472,7 +94472,7 @@ SQLITE_PRIVATE int sqlite3Select( */ if( pGroupBy ){ KeyInfo *pKeyInfo; /* Keying information for the group by clause */ - int j1; /* A-vs-B comparision jump */ + int j1; /* A-vs-B comparison jump */ int addrOutputRow; /* Start of subroutine that outputs a result row */ int regOutputRow; /* Return address register for output subroutine */ int addrSetAbort; /* Set the abort flag and return */ @@ -96115,7 +96115,7 @@ SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect( /* ** This is called to code the required FOR EACH ROW triggers for an operation ** on table pTab. The operation to code triggers for (INSERT, UPDATE or DELETE) -** is given by the op paramater. The tr_tm parameter determines whether the +** is given by the op parameter. The tr_tm parameter determines whether the ** BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then ** parameter pChanges is passed the list of columns being modified. ** @@ -99313,7 +99313,7 @@ static void exprAnalyzeOrTerm( } if( (chngToIN & getMask(pMaskSet, pOrTerm->leftCursor))==0 ){ /* This term must be of the form t1.a==t2.b where t2 is in the - ** chngToIN set but t1 is not. This term will be either preceeded + ** chngToIN set but t1 is not. This term will be either preceded ** or follwed by an inverted copy (t2.b==t1.a). Skip this term ** and use its inversion. */ testcase( pOrTerm->wtFlags & TERM_COPIED ); @@ -102953,7 +102953,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( ** (1) The table must not depend on other tables that have not ** yet run. ** - ** (2) A full-table-scan plan cannot supercede indexed plan unless + ** (2) A full-table-scan plan cannot supersede indexed plan unless ** the full-table-scan is an "optimal" plan as defined above. ** ** (3) All tables have an INDEXED BY clause or this table lacks an @@ -107619,7 +107619,7 @@ SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[]; ** a statement. ** ** (4) CREATE The keyword CREATE has been seen at the beginning of a -** statement, possibly preceeded by EXPLAIN and/or followed by +** statement, possibly preceded by EXPLAIN and/or followed by ** TEMP or TEMPORARY ** ** (5) TRIGGER We are in the middle of a trigger definition that must be @@ -108525,7 +108525,7 @@ static int binCollFunc( /* ** Another built-in collating sequence: NOCASE. ** -** This collating sequence is intended to be used for "case independant +** This collating sequence is intended to be used for "case independent ** comparison". SQLite's knowledge of upper and lower case equivalents ** extends only to the 26 characters used in the English language. ** @@ -116368,7 +116368,7 @@ SQLITE_PRIVATE int sqlite3Fts3EvalPhraseStats( ** of the current row. ** ** More specifically, the returned buffer contains 1 varint for each -** occurence of the phrase in the column, stored using the normal (delta+2) +** occurrence of the phrase in the column, stored using the normal (delta+2) ** compression and is terminated by either an 0x01 or 0x00 byte. For example, ** if the requested column contains "a b X c d X X" and the position-list ** for 'X' is requested, the buffer returned may contain: @@ -118508,7 +118508,7 @@ static int star_oh(const char *z){ /* ** If the word ends with zFrom and xCond() is true for the stem -** of the word that preceeds the zFrom ending, then change the +** of the word that precede the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo @@ -123270,9 +123270,9 @@ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ ** is the snippet with the highest score, where scores are calculated ** by adding: ** -** (a) +1 point for each occurence of a matchable phrase in the snippet. +** (a) +1 point for each occurrence of a matchable phrase in the snippet. ** -** (b) +1000 points for the first occurence of each matchable phrase in +** (b) +1000 points for the first occurrence of each matchable phrase in ** the snippet for which the corresponding mCovered bit is not set. ** ** The selected snippet parameters are stored in structure *pFragment before @@ -123373,7 +123373,7 @@ static int fts3StringAppend( } /* If there is insufficient space allocated at StrBuffer.z, use realloc() - ** to grow the buffer until so that it is big enough to accomadate the + ** to grow the buffer until so that it is big enough to accommodate the ** appended data. */ if( pStr->n+nAppend+1>=pStr->nAlloc ){ @@ -127688,7 +127688,7 @@ SQLITE_API int sqlite3_extension_init( ** * Implementations of the SQL scalar upper() and lower() functions ** for case mapping. ** -** * Integration of ICU and SQLite collation seqences. +** * Integration of ICU and SQLite collation sequences. ** ** * An implementation of the LIKE operator that uses ICU to ** provide case-independent matching. diff --git a/ext/sqlite3/php_sqlite3_structs.h b/ext/sqlite3/php_sqlite3_structs.h index 0e813b6df..6c65e02ee 100644 --- a/ext/sqlite3/php_sqlite3_structs.h +++ b/ext/sqlite3/php_sqlite3_structs.h @@ -23,7 +23,7 @@ #include <sqlite3.h> -/* for backwards compatability reasons */ +/* for backwards compatibility reasons */ #ifndef SQLITE_OPEN_READONLY #define SQLITE_OPEN_READONLY 0x00000001 #endif diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index df449d738..2aef0414a 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1409,7 +1409,7 @@ static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *pa /* }}} */ /* {{{ proto bool SQLite3Stmt::bindParam(int parameter_number, mixed parameter [, int type]) - Bind Paramater to a stmt variable. */ + Bind Parameter to a stmt variable. */ PHP_METHOD(sqlite3stmt, bindParam) { php_sqlite3_stmt *stmt_obj; diff --git a/ext/standard/array.c b/ext/standard/array.c index 40a27c053..1deacc715 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -352,7 +352,7 @@ PHP_FUNCTION(count) /* Numbers are always smaller than strings int this function as it * anyway doesn't make much sense to compare two different data types. - * This keeps it consistant and simple. + * This keeps it consistent and simple. * * This is not correct any more, depends on what compare_func is set to. */ @@ -1053,7 +1053,7 @@ PHP_FUNCTION(max) static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive TSRMLS_DC) /* {{{ */ { zval **args[3], /* Arguments to userland function */ - *retval_ptr, /* Return value - unused */ + *retval_ptr = NULL, /* Return value - unused */ *key=NULL; /* Entry key */ char *string_key; uint string_key_len; @@ -2877,7 +2877,7 @@ static int zval_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */ static int zval_user_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */ { zval **args[2]; - zval *retval_ptr; + zval *retval_ptr = NULL; args[0] = (zval **) a; args[1] = (zval **) b; @@ -2996,8 +2996,8 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int char *param_spec; zend_fcall_info fci1, fci2; zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache; - zend_fcall_info *fci_key, *fci_data; - zend_fcall_info_cache *fci_key_cache, *fci_data_cache; + zend_fcall_info *fci_key = NULL, *fci_data; + zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache; PHP_ARRAY_CMP_FUNC_VARS; int (*intersect_key_compare_func)(const void *, const void * TSRMLS_DC); @@ -3414,8 +3414,8 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ char *param_spec; zend_fcall_info fci1, fci2; zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache; - zend_fcall_info *fci_key, *fci_data; - zend_fcall_info_cache *fci_key_cache, *fci_data_cache; + zend_fcall_info *fci_key = NULL, *fci_data; + zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache; PHP_ARRAY_CMP_FUNC_VARS; int (*diff_key_compare_func)(const void *, const void * TSRMLS_DC); @@ -4019,7 +4019,6 @@ PHP_FUNCTION(array_sum) **entry, entry_n; HashPosition pos; - double dval; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) { return; @@ -4037,17 +4036,7 @@ PHP_FUNCTION(array_sum) entry_n = **entry; zval_copy_ctor(&entry_n); convert_scalar_to_number(&entry_n TSRMLS_CC); - - if (Z_TYPE(entry_n) == IS_LONG && Z_TYPE_P(return_value) == IS_LONG) { - dval = (double)Z_LVAL_P(return_value) + (double)Z_LVAL(entry_n); - if ( (double)LONG_MIN <= dval && dval <= (double)LONG_MAX ) { - Z_LVAL_P(return_value) += Z_LVAL(entry_n); - continue; - } - } - convert_to_double(return_value); - convert_to_double(&entry_n); - Z_DVAL_P(return_value) += Z_DVAL(entry_n); + fast_add_function(return_value, return_value, &entry_n TSRMLS_CC); } } /* }}} */ diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 1e1252f60..ed773b851 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -451,6 +451,19 @@ static int browser_reg_compare(zval **browser TSRMLS_DC, int num_args, va_list a } /* }}} */ +static void browscap_zval_copy_ctor(zval **p) /* {{{ */ +{ + zval *new; + + ALLOC_ZVAL(new); + *new = **p; + + zval_copy_ctor(new); + + INIT_PZVAL(new); + *p = new; +} /* }}} */ + /* {{{ proto mixed get_browser([string browser_name [, bool return_array]]) Get information about the capabilities of a browser. If browser_name is omitted or null, HTTP_USER_AGENT is used. Returns an object by default; if return_array is true, returns an array. */ PHP_FUNCTION(get_browser) @@ -511,11 +524,11 @@ PHP_FUNCTION(get_browser) if (return_array) { array_init(return_value); - zend_hash_copy(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); + zend_hash_copy(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *)); } else { object_init(return_value); - zend_hash_copy(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); + zend_hash_copy(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *)); } while (zend_hash_find(Z_ARRVAL_PP(agent), "parent", sizeof("parent"), (void **) &z_agent_name) == SUCCESS) { @@ -524,10 +537,10 @@ PHP_FUNCTION(get_browser) } if (return_array) { - zend_hash_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *), 0); + zend_hash_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *), 0); } else { - zend_hash_merge(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *), 0); + zend_hash_merge(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *), 0); } } diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index c33ae1e05..c1f5aff7c 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -358,7 +358,29 @@ else AC_MSG_RESULT(no) fi -if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" = "cli" || test "$PHP_SAPI" = "embed"; then +PHP_ENABLE_CHROOT_FUNC=no +case "$PHP_SAPI" in + embed) + PHP_ENABLE_CHROOT_FUNC=yes + ;; + + none) + for PROG in $PHP_BINARIES; do + case "$PROG" in + cgi|cli) + PHP_ENABLE_CHROOT_FUNC=yes + ;; + + *) + PHP_ENABLE_CHROOT_FUNC=no + break + ;; + esac + done + ;; +esac + +if test "$PHP_ENABLE_CHROOT_FUNC" = "yes"; then AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function]) fi diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index ce2987bfc..73be21d9a 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -904,7 +904,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ } if (php_stream_stat_path_ex((char *)filename, flags, &ssb, NULL)) { - /* Error Occured */ + /* Error Occurred */ if (!IS_EXISTS_CHECK(type)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename); } diff --git a/ext/standard/filters.c b/ext/standard/filters.c index 084860c76..15dae1bee 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -771,7 +771,7 @@ static void php_conv_qprint_encode_dtor(php_conv_qprint_encode *inst) } #define NEXT_CHAR(ps, icnt, lb_ptr, lb_cnt, lbchars) \ - ((lb_ptr) < (lb_cnt) ? (lbchars)[(lb_ptr)] : *(ps)) + ((lb_ptr) < (lb_cnt) ? (lbchars)[(lb_ptr)] : *(ps)) #define CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt) \ if ((lb_ptr) < (lb_cnt)) { \ @@ -791,6 +791,7 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins unsigned int line_ccnt; unsigned int lb_ptr; unsigned int lb_cnt; + unsigned int trail_ws; int opts; static char qp_digits[] = "0123456789ABCDEF"; @@ -807,6 +808,7 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins icnt = *in_left_p; pd = (unsigned char *)(*out_pp); ocnt = *out_left_p; + trail_ws = 0; for (;;) { if (!(opts & PHP_CONV_QPRINT_OPT_BINARY) && inst->lbchars != NULL && inst->lbchars_len > 0) { @@ -839,11 +841,13 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins if (lb_ptr >= lb_cnt && icnt <= 0) { break; - } + } c = NEXT_CHAR(ps, icnt, lb_ptr, lb_cnt, inst->lbchars); - if (!(opts & PHP_CONV_QPRINT_OPT_BINARY) && (c == '\t' || c == ' ')) { + if (!(opts & PHP_CONV_QPRINT_OPT_BINARY) && + (trail_ws == 0) && + (c == '\t' || c == ' ')) { if (line_ccnt < 2 && inst->lbchars != NULL) { if (ocnt < inst->lbchars_len + 1) { err = PHP_CONV_ERR_TOO_BIG; @@ -863,12 +867,44 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins err = PHP_CONV_ERR_TOO_BIG; break; } - *(pd++) = c; - ocnt--; - line_ccnt--; - CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt); + + /* Check to see if this is EOL whitespace. */ + if (inst->lbchars != NULL) { + unsigned char *ps2; + unsigned int j, lb_cnt2; + + lb_cnt2 = 0; + ps2 = ps; + trail_ws = 1; + + for (j = icnt - 1; j > 0; j--, ps2++) { + if (*ps2 == inst->lbchars[lb_cnt2]) { + lb_cnt2++; + if (lb_cnt2 >= inst->lbchars_len) { + /* Found trailing ws. Reset to top of main + * for loop to allow for code to do necessary + * wrapping/encoding. */ + break; + } + } else if (lb_cnt2 != 0 || (*ps2 != '\t' && *ps2 != ' ')) { + /* At least one non-EOL character following, so + * don't need to encode ws. */ + trail_ws = 0; + break; + } else { + trail_ws++; + } + } + } + + if (trail_ws == 0) { + *(pd++) = c; + ocnt--; + line_ccnt--; + CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt); + } } - } else if ((!(opts & PHP_CONV_QPRINT_OPT_FORCE_ENCODE_FIRST) || line_ccnt < inst->line_len) && ((c >= 33 && c <= 60) || (c >= 62 && c <= 126))) { + } else if ((!(opts & PHP_CONV_QPRINT_OPT_FORCE_ENCODE_FIRST) || line_ccnt < inst->line_len) && ((c >= 33 && c <= 60) || (c >= 62 && c <= 126))) { if (line_ccnt < 2 && inst->lbchars != NULL) { if (ocnt < inst->lbchars_len + 1) { err = PHP_CONV_ERR_TOO_BIG; @@ -912,9 +948,12 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins } *(pd++) = '='; *(pd++) = qp_digits[(c >> 4)]; - *(pd++) = qp_digits[(c & 0x0f)]; + *(pd++) = qp_digits[(c & 0x0f)]; ocnt -= 3; line_ccnt -= 3; + if (trail_ws > 0) { + trail_ws--; + } CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt); } } @@ -922,7 +961,7 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins *in_pp = (const char *)ps; *in_left_p = icnt; *out_pp = (char *)pd; - *out_left_p = ocnt; + *out_left_p = ocnt; inst->line_ccnt = line_ccnt; inst->lb_ptr = lb_ptr; inst->lb_cnt = lb_cnt; diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 373293935..86975d7f5 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -440,7 +440,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch if (strchr(mode, 'a')) { read_write = 3; /* Open for Appending */ } else { - read_write = 2; /* Open for writting */ + read_write = 2; /* Open for writing */ } } if (!read_write) { @@ -500,7 +500,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch } if (result <= 299 && result >= 200) { if (allow_overwrite) { - /* Context permits overwritting file, + /* Context permits overwriting file, so we just delete whatever's there in preparation */ php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path); result = GET_FTP_RESULT(stream); diff --git a/ext/standard/html.c b/ext/standard/html.c index 414fa65c9..b4d9ba109 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -1221,8 +1221,8 @@ PHPAPI char *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, size const enc_to_uni *to_uni_table = NULL; const entity_ht *inv_map = NULL; /* used for !double_encode */ /* only used if flags includes ENT_HTML_IGNORE_ERRORS or ENT_HTML_SUBSTITUTE_DISALLOWED_CHARS */ - const unsigned char *replacement; - size_t replacement_len; + const unsigned char *replacement = NULL; + size_t replacement_len = 0; if (all) { /* replace with all named entities */ if (CHARSET_PARTIAL_SUPPORT(charset)) { @@ -1596,7 +1596,7 @@ PHP_FUNCTION(get_html_translation_table) flags = ENT_COMPAT; int doctype; entity_table_opt entity_table; - const enc_to_uni *to_uni_table; + const enc_to_uni *to_uni_table = NULL; char *charset_hint = NULL; int charset_hint_len; enum entity_charset charset; diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index b8676bbba..4605e7494 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -84,6 +84,30 @@ #define HTTP_WRAPPER_HEADER_INIT 1 #define HTTP_WRAPPER_REDIRECTED 2 +static inline void strip_header(char *header_bag, char *lc_header_bag, + const char *lc_header_name) +{ + char *lc_header_start = strstr(lc_header_bag, lc_header_name); + char *header_start = header_bag + (lc_header_start - lc_header_bag); + + if (lc_header_start + && (lc_header_start == lc_header_bag || *(lc_header_start-1) == '\n') + ) { + char *lc_eol = strchr(lc_header_start, '\n'); + char *eol = header_start + (lc_eol - lc_header_start); + + if (lc_eol) { + size_t eollen = strlen(lc_eol); + + memmove(lc_header_start, lc_eol+1, eollen); + memmove(header_start, eol+1, eollen); + } else { + *lc_header_start = '\0'; + *header_start = '\0'; + } + } +} + php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ { php_stream *stream = NULL; @@ -425,40 +449,17 @@ finish: if (tmp && strlen(tmp) > 0) { char *s; - if (!header_init) { /* Remove post headers for redirects */ - int l = strlen(tmp); - char *s2, *tmp_c = estrdup(tmp); - - php_strtolower(tmp_c, l); - if ((s = strstr(tmp_c, "content-length:"))) { - if ((s2 = memchr(s, '\n', tmp_c + l - s))) { - int b = tmp_c + l - 1 - s2; - memmove(tmp, tmp + (s2 + 1 - tmp_c), b); - memmove(tmp_c, s2 + 1, b); - - } else { - tmp[s - tmp_c] = *s = '\0'; - } - l = strlen(tmp_c); - } - if ((s = strstr(tmp_c, "content-type:"))) { - if ((s2 = memchr(s, '\n', tmp_c + l - s))) { - memmove(tmp, tmp + (s2 + 1 - tmp_c), tmp_c + l - 1 - s2); - } else { - tmp[s - tmp_c] = '\0'; - } - } - - efree(tmp_c); - tmp_c = php_trim(tmp, strlen(tmp), NULL, 0, NULL, 3 TSRMLS_CC); - efree(tmp); - tmp = tmp_c; - } - user_headers = estrdup(tmp); /* Make lowercase for easy comparison against 'standard' headers */ php_strtolower(tmp, strlen(tmp)); + + if (!header_init) { + /* strip POST headers on redirect */ + strip_header(user_headers, tmp, "content-length:"); + strip_header(user_headers, tmp, "content-type:"); + } + if ((s = strstr(tmp, "user-agent:")) && (s == tmp || *(s-1) == '\r' || *(s-1) == '\n' || *(s-1) == '\t' || *(s-1) == ' ')) { diff --git a/ext/standard/image.c b/ext/standard/image.c index 4984e4064..bd80f11de 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -112,7 +112,7 @@ static struct gfxinfo *php_handle_gif (php_stream * stream TSRMLS_DC) result->width = (unsigned int)dim[0] | (((unsigned int)dim[1])<<8); result->height = (unsigned int)dim[2] | (((unsigned int)dim[3])<<8); result->bits = dim[4]&0x80 ? ((((unsigned int)dim[4])&0x07) + 1) : 0; - result->channels = 3; /* allways */ + result->channels = 3; /* always */ return result; } @@ -606,7 +606,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC) /* JPEG 2000 components can be vastly different from one another. Each component can be sampled at a different resolution, use - a different colour space, have a seperate colour depth, and + a different colour space, have a separate colour depth, and be compressed totally differently! This makes giving a single "bit depth" answer somewhat problematic. For this implementation we'll use the highest depth encountered. */ diff --git a/ext/standard/info.c b/ext/standard/info.c index e171f72b5..cb2e46984 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -125,7 +125,11 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC zend_hash_internal_pointer_reset_ex(ht, &pos); while (zend_hash_get_current_key_ex(ht, &key, &len, NULL, 0, &pos) == HASH_KEY_IS_STRING) { - php_info_print(key); + if (!sapi_module.phpinfo_as_text) { + php_info_print_html_esc(key, len-1); + } else { + php_info_print(key); + } zend_hash_move_forward_ex(ht, &pos); if (zend_hash_get_current_key_ex(ht, &key, &len, NULL, 0, &pos) == HASH_KEY_IS_STRING) { php_info_print(", "); @@ -291,7 +295,7 @@ void php_info_print_style(TSRMLS_D) PHPAPI char *php_info_html_esc(char *string TSRMLS_DC) { size_t new_len; - return php_escape_html_entities(string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC); + return php_escape_html_entities((unsigned char *) string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC); } /* }}} */ diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 25766818f..b4f6a926c 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -318,7 +318,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char sendmail = popen_ex(sendmail_cmd, "wb", NULL, NULL TSRMLS_CC); #else /* Since popen() doesn't indicate if the internal fork() doesn't work - * (e.g. the shell can't be executed) we explicitely set it to 0 to be + * (e.g. the shell can't be executed) we explicitly set it to 0 to be * sure we don't catch any older errno value. */ errno = 0; sendmail = popen(sendmail_cmd, "w"); diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 29419d211..eb80395f5 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -69,7 +69,7 @@ char machine_little_endian; /* Mapping of byte from char (8bit) to long for machine endian */ static int byte_map[1]; -/* Mappings of bytes from int (machine dependant) to int for machine endian */ +/* Mappings of bytes from int (machine dependent) to int for machine endian */ static int int_map[sizeof(int)]; /* Mappings of bytes from shorts (16bit) for all endian environments */ @@ -503,7 +503,7 @@ static long php_unpack(char *data, int size, int issigned, int *map) /* unpack() is based on Perl's unpack(), but is modified a bit from there. * Rather than depending on error-prone ordered lists or syntactically - * unpleasant pass-by-reference, we return an object with named paramters + * unpleasant pass-by-reference, we return an object with named parameters * (like *_fetch_object()). Syntax is "f[repeat]name/...", where "f" is the * formatter char (like pack()), "[repeat]" is the optional repeater argument, * and "name" is the name of the variable to use. diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index 35343b3d5..afc5f178e 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -115,6 +115,7 @@ do { \ PHPAPI void var_replace(php_unserialize_data_t *var_hash, zval *ozval, zval **nzval); PHPAPI void var_push_dtor(php_unserialize_data_t *var_hash, zval **val); +PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval); PHPAPI void var_destroy(php_unserialize_data_t *var_hash); #define PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash, ozval, nzval) \ diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index 28dcc63f1..0df127362 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -151,7 +151,7 @@ PHPAPI unsigned char *php_quot_print_encode(const unsigned char *str, size_t len unsigned char c, *ret, *d; char *hex = "0123456789ABCDEF"; - ret = safe_emalloc(1, 3 * length + 3 * (((3 * length)/PHP_QPRINT_MAXL) + 1), 0); + ret = safe_emalloc(3, length + (((3 * length)/(PHP_QPRINT_MAXL-9)) + 1), 1); d = ret; while (length--) { @@ -286,4 +286,4 @@ PHP_FUNCTION(quoted_printable_encode) * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 - */
\ No newline at end of file + */ diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 21c55e404..f487763b9 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -601,7 +601,6 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t { zval **elem; php_stream *stream; - php_socket_t this_fd; int cnt = 0; if (Z_TYPE_P(stream_array) != IS_ARRAY) { @@ -611,6 +610,11 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t zend_hash_get_current_data(Z_ARRVAL_P(stream_array), (void **) &elem) == SUCCESS; zend_hash_move_forward(Z_ARRVAL_P(stream_array))) { + /* Temporary int fd is needed for the STREAM data type on windows, passing this_fd directly to php_stream_cast() + would eventually bring a wrong result on x64. php_stream_cast() casts to int internally, and this will leave + the higher bits of a SOCKET variable uninitialized on systems with little endian. */ + int tmp_fd; + php_stream_from_zval_no_verify(stream, elem); if (stream == NULL) { continue; @@ -620,7 +624,9 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t * when casting. It is only used here so that the buffered data warning * is not displayed. * */ - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd != -1) { + if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&tmp_fd, 1) && tmp_fd != -1) { + + php_socket_t this_fd = (php_socket_t)tmp_fd; PHP_SAFE_FD_SET(this_fd, fds); @@ -638,7 +644,6 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC) zval **elem, **dest_elem; php_stream *stream; HashTable *new_hash; - php_socket_t this_fd; int ret = 0; if (Z_TYPE_P(stream_array) != IS_ARRAY) { @@ -655,6 +660,11 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC) char *key; uint key_len; ulong num_ind; + /* Temporary int fd is needed for the STREAM data type on windows, passing this_fd directly to php_stream_cast() + would eventually bring a wrong result on x64. php_stream_cast() casts to int internally, and this will leave + the higher bits of a SOCKET variable uninitialized on systems with little endian. */ + int tmp_fd; + type = zend_hash_get_current_key_ex(Z_ARRVAL_P(stream_array), &key, &key_len, &num_ind, 0, NULL); @@ -672,7 +682,10 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC) * when casting. It is only used here so that the buffered data warning * is not displayed. */ - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd != -1) { + if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&tmp_fd, 1) && tmp_fd != -1) { + + php_socket_t this_fd = (php_socket_t)tmp_fd; + if (PHP_SAFE_FD_ISSET(this_fd, fds)) { if (type == HASH_KEY_IS_LONG) { zend_hash_index_update(new_hash, num_ind, (void *)elem, sizeof(zval *), (void **)&dest_elem); @@ -1578,7 +1591,7 @@ PHP_FUNCTION(stream_is_local) /* }}} */ /* {{{ proto bool stream_supports_lock(resource stream) - Tells wether the stream supports locking through flock(). */ + Tells whether the stream supports locking through flock(). */ PHP_FUNCTION(stream_supports_lock) { php_stream *stream; diff --git a/ext/standard/string.c b/ext/standard/string.c index 77e0dff4c..c744cb46f 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1581,7 +1581,7 @@ PHP_FUNCTION(pathinfo) const char *p; int idx; - /* Have we alrady looked up the basename? */ + /* Have we already looked up the basename? */ if (!have_basename && !ret) { php_basename(path, path_len, NULL, 0, &ret, &ret_len TSRMLS_CC); } @@ -3253,7 +3253,7 @@ static void php_similar_str(const char *txt1, int len1, const char *txt2, int le static int php_similar_char(const char *txt1, int len1, const char *txt2, int len2) { int sum; - int pos1, pos2, max; + int pos1 = 0, pos2 = 0, max; php_similar_str(txt1, len1, txt2, len2, &pos1, &pos2, &max); if ((sum = max)) { @@ -4613,7 +4613,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, char *tbuf, *buf, *p, *tp, *rp, c, lc; int br, i=0, depth=0, in_q = 0; int state = 0, pos; - char *allow_free; + char *allow_free = NULL; if (stateptr) state = *stateptr; diff --git a/ext/standard/tests/array/009.phpt b/ext/standard/tests/array/009.phpt index f88f8763f..7b3bba226 100644 --- a/ext/standard/tests/array/009.phpt +++ b/ext/standard/tests/array/009.phpt @@ -94,7 +94,7 @@ var_dump( current($temp_array, $temp_array) ); var_dump( reset($temp_array, $temp_array) ); var_dump( next($temp_array, $temp_array) ); -// invalid args type, valid arguement: array +// invalid args type, valid argument: array $int_var = 1; $float_var = 1.5; $string = "string"; diff --git a/ext/standard/tests/array/array_combine_variation3.phpt b/ext/standard/tests/array/array_combine_variation3.phpt index 03de63290..1381fe0f4 100644 --- a/ext/standard/tests/array/array_combine_variation3.phpt +++ b/ext/standard/tests/array/array_combine_variation3.phpt @@ -29,7 +29,7 @@ the lazy dog This is a double quoted string EOT; -// heredoc with diferent whitespaces +// heredoc with different whitespaces $diff_whitespaces = <<<EOT hello\r world\t 1111\t\t != 2222\v\v diff --git a/ext/standard/tests/array/array_count_values_variation.phpt b/ext/standard/tests/array/array_count_values_variation.phpt index 89d7f37b1..1d614b452 100644 --- a/ext/standard/tests/array/array_count_values_variation.phpt +++ b/ext/standard/tests/array/array_count_values_variation.phpt @@ -1,5 +1,5 @@ --TEST-- -Test array_count_values() function : Test all normal paramter variations +Test array_count_values() function : Test all normal parameter variations --FILE-- <?php /* Prototype : proto array array_count_values(array input) @@ -9,7 +9,7 @@ Test array_count_values() function : Test all normal paramter variations */ /* - * Test behaviour with paramter variations + * Test behaviour with parameter variations */ echo "*** Testing array_count_values() : parameter variations ***\n"; diff --git a/ext/standard/tests/array/array_fill_basic.phpt b/ext/standard/tests/array/array_fill_basic.phpt index 8623f8e6c..309c9ca07 100644 --- a/ext/standard/tests/array/array_fill_basic.phpt +++ b/ext/standard/tests/array/array_fill_basic.phpt @@ -16,7 +16,7 @@ $heredoc = <<<HERE_DOC Hello HERE_DOC; -// array of possible valid values for 'val' arugment +// array of possible valid values for 'val' argument $values = array ( /* 1 */ NULL, diff --git a/ext/standard/tests/array/array_fill_keys_error.phpt b/ext/standard/tests/array/array_fill_keys_error.phpt index 31a03e7f5..012a729d6 100644 --- a/ext/standard/tests/array/array_fill_keys_error.phpt +++ b/ext/standard/tests/array/array_fill_keys_error.phpt @@ -20,7 +20,7 @@ var_dump( array_fill_keys($keys, $val, $extra_arg) ); echo "\n-- Testing array_fill_keys() function with less than expected no. of arguments --\n"; var_dump( array_fill_keys($keys) ); -echo "\n-- Testing array_fill_keys() function with no argumets --\n"; +echo "\n-- Testing array_fill_keys() function with no arguments --\n"; var_dump( array_fill_keys() ); echo "Done"; @@ -38,7 +38,7 @@ NULL Warning: array_fill_keys() expects exactly 2 parameters, 1 given in %sarray_fill_keys_error.php on line %d NULL --- Testing array_fill_keys() function with no argumets -- +-- Testing array_fill_keys() function with no arguments -- Warning: array_fill_keys() expects exactly 2 parameters, 0 given in %sarray_fill_keys_error.php on line %d NULL diff --git a/ext/standard/tests/array/array_fill_variation4.phpt b/ext/standard/tests/array/array_fill_variation4.phpt index 9e1f50c68..13b566a7d 100644 --- a/ext/standard/tests/array/array_fill_variation4.phpt +++ b/ext/standard/tests/array/array_fill_variation4.phpt @@ -17,7 +17,7 @@ $heredoc = <<<HERE_DOC Hello HERE_DOC; -// array of possible valid values for 'val' arugment +// array of possible valid values for 'val' argument $values = array ( /* 1 */ NULL, diff --git a/ext/standard/tests/array/array_intersect_assoc_variation3.phpt b/ext/standard/tests/array/array_intersect_assoc_variation3.phpt index 50be08059..e3f0ae08e 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation3.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation3.phpt @@ -31,7 +31,7 @@ the lazy dog This is a double quoted string EOT; -// heredoc with diferent whitespaces +// heredoc with different whitespaces $diff_whitespaces = <<<EOT hello\r world\t 1111\t\t != 2222\v\v diff --git a/ext/standard/tests/array/array_intersect_assoc_variation4.phpt b/ext/standard/tests/array/array_intersect_assoc_variation4.phpt index ed2e3d951..9eb342f8e 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation4.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation4.phpt @@ -31,7 +31,7 @@ the lazy dog This is a double quoted string EOT; -// heredoc with diferent whitespaces +// heredoc with different whitespaces $diff_whitespaces = <<<EOT hello\r world\t 1111\t\t != 2222\v\v diff --git a/ext/standard/tests/array/array_intersect_variation3.phpt b/ext/standard/tests/array/array_intersect_variation3.phpt index b2b7d8ac0..c404e58ba 100644 --- a/ext/standard/tests/array/array_intersect_variation3.phpt +++ b/ext/standard/tests/array/array_intersect_variation3.phpt @@ -30,7 +30,7 @@ the lazy dog This is a double quoted string EOT; -// heredoc with diferent whitespaces +// heredoc with different whitespaces $diff_whitespaces = <<<EOT hello\r world\t 1111\t\t != 2222\v\v diff --git a/ext/standard/tests/array/array_intersect_variation4.phpt b/ext/standard/tests/array/array_intersect_variation4.phpt index 4f1d6f3dd..66624a66c 100644 --- a/ext/standard/tests/array/array_intersect_variation4.phpt +++ b/ext/standard/tests/array/array_intersect_variation4.phpt @@ -30,7 +30,7 @@ the lazy dog This is a double quoted string EOT; -// heredoc with diferent whitespaces +// heredoc with different whitespaces $diff_whitespaces = <<<EOT hello\r world\t 1111\t\t != 2222\v\v diff --git a/ext/standard/tests/array/array_key_exists.phpt b/ext/standard/tests/array/array_key_exists.phpt index f433e1256..37ac0f8ec 100644 --- a/ext/standard/tests/array/array_key_exists.phpt +++ b/ext/standard/tests/array/array_key_exists.phpt @@ -114,7 +114,7 @@ var_dump(array_key_exists("print_member", $key_check_obj)); // not found, its a var_dump(array_key_exists("arr", $key_check_obj)); //found, public member var_dump(array_key_exists("var", $key_check_obj->arr)); //found, key is in member array -/* error condition, first arguemnt as object */ +/* error condition, first argument as object */ var_dump( array_key_exists($key_check_obj, $key_check_obj) ); echo "Done\n"; ?> diff --git a/ext/standard/tests/array/array_key_exists_variation2.phpt b/ext/standard/tests/array/array_key_exists_variation2.phpt index a6e9cd2bb..69a1f0a6d 100644 --- a/ext/standard/tests/array/array_key_exists_variation2.phpt +++ b/ext/standard/tests/array/array_key_exists_variation2.phpt @@ -1,5 +1,5 @@ --TEST-- -Test array_key_exists() function : usage variations - Pass differnt data types to $search arg +Test array_key_exists() function : usage variations - Pass different data types to $search arg --FILE-- <?php /* Prototype : bool array_key_exists(mixed $key, array $search) diff --git a/ext/standard/tests/array/array_merge.phpt b/ext/standard/tests/array/array_merge.phpt index b718386da..30830de2b 100644 --- a/ext/standard/tests/array/array_merge.phpt +++ b/ext/standard/tests/array/array_merge.phpt @@ -79,7 +79,7 @@ echo "\n*** Testing array_merge() with typecasting non-array to array ***\n"; var_dump(array_merge($begin_array[4], (array)"type1", (array)10, (array)12.34)); echo "\n*** Testing error conditions ***"; -/* Invalid argumens */ +/* Invalid arguments */ var_dump(array_merge()); var_dump(array_merge(100, 200)); var_dump(array_merge($begin_array[0], $begin_array[1], 100)); diff --git a/ext/standard/tests/array/array_merge_recursive_variation3.phpt b/ext/standard/tests/array/array_merge_recursive_variation3.phpt index 722388a01..76bf91391 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation3.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation3.phpt @@ -30,7 +30,7 @@ the lazy dog This is a double quoted string EOT; -// heredoc with diferent whitespaces +// heredoc with different whitespaces $diff_whitespaces = <<<EOT hello\r world\t 1111\t\t != 2222\v\v diff --git a/ext/standard/tests/array/array_pad_variation6.phpt b/ext/standard/tests/array/array_pad_variation6.phpt index 2f97e3ee5..a49157390 100644 --- a/ext/standard/tests/array/array_pad_variation6.phpt +++ b/ext/standard/tests/array/array_pad_variation6.phpt @@ -31,7 +31,7 @@ the lazy dog This is a double quoted string EOT; -// heredoc with diferent whitespaces +// heredoc with different whitespaces $diff_whitespaces = <<<EOT hello\r world\t 1111\t\t != 2222\v\v diff --git a/ext/standard/tests/array/array_search_variation4.phpt b/ext/standard/tests/array/array_search_variation4.phpt index 04f3b9138..c247879cc 100644 --- a/ext/standard/tests/array/array_search_variation4.phpt +++ b/ext/standard/tests/array/array_search_variation4.phpt @@ -16,7 +16,7 @@ $file_handle = fopen(__FILE__, "r"); //directory type resource $dir_handle = opendir( dirname(__FILE__) ); -//store resources in array for comparision. +//store resources in array for comparison. $resources = array($file_handle, $dir_handle); // search for resouce type in the resource array diff --git a/ext/standard/tests/array/array_unique_variation2.phpt b/ext/standard/tests/array/array_unique_variation2.phpt index 3cfcfba2b..757dd6e05 100644 --- a/ext/standard/tests/array/array_unique_variation2.phpt +++ b/ext/standard/tests/array/array_unique_variation2.phpt @@ -29,7 +29,7 @@ the lazy dog This is a double quoted string EOT; -// heredoc with diferent whitespaces +// heredoc with different whitespaces $diff_whitespaces = <<<EOT hello\r world\t 1111\t\t != 2222\v\v diff --git a/ext/standard/tests/array/array_unshift_variation9.phpt b/ext/standard/tests/array/array_unshift_variation9.phpt index a667e6da0..b6440f899 100644 --- a/ext/standard/tests/array/array_unshift_variation9.phpt +++ b/ext/standard/tests/array/array_unshift_variation9.phpt @@ -33,7 +33,7 @@ the lazy dog This is a double quoted string EOT; -// heredoc with diferent whitespaces +// heredoc with different whitespaces $diff_whitespaces = <<<EOT hello\r world\t 1111\t\t != 2222\v\v diff --git a/ext/standard/tests/array/array_values_variation7.phpt b/ext/standard/tests/array/array_values_variation7.phpt index b71306456..660809357 100644 --- a/ext/standard/tests/array/array_values_variation7.phpt +++ b/ext/standard/tests/array/array_values_variation7.phpt @@ -9,7 +9,7 @@ Test array_values() function : usage variations - Internal order check /* * Check that array_values is re-assigning keys according to the internal order of the array, - * and is not dependant on the \$input argument's keys + * and is not dependent on the \$input argument's keys */ echo "*** Testing array_values() : usage variations ***\n"; diff --git a/ext/standard/tests/array/array_walk_basic2.phpt b/ext/standard/tests/array/array_walk_basic2.phpt index e856b580b..3ef15605e 100644 --- a/ext/standard/tests/array/array_walk_basic2.phpt +++ b/ext/standard/tests/array/array_walk_basic2.phpt @@ -25,7 +25,7 @@ function test_alter(&$item, $key, $prefix) // with proper type var_dump($item); // value var_dump($key); // key - var_dump($prefix); // additional agument passed to callback function + var_dump($prefix); // additional argument passed to callback function echo "\n"; // new line to separate the output between each element } diff --git a/ext/standard/tests/array/array_walk_closure.phpt b/ext/standard/tests/array/array_walk_closure.phpt new file mode 100644 index 000000000..4e22bb894 --- /dev/null +++ b/ext/standard/tests/array/array_walk_closure.phpt @@ -0,0 +1,251 @@ +--TEST-- +array_walk() closure tests +--FILE-- +<?php + +var_dump(array_walk()); + +$ar = false; +var_dump(array_walk($ar, $ar)); + +$ar = NULL; +var_dump(array_walk($ar, $ar)); + +$ar = ["one" => 1, "two"=>2, "three" => 3]; +var_dump(array_walk($ar, function(){ var_dump(func_get_args());})); + +echo "\nclosure with array\n"; +$ar = ["one" => 1, "two"=>2, "three" => 3]; +$user_data = ["sum" => 42]; +$func = function($value, $key, &$udata) { + var_dump($udata); + $udata["sum"] += $value; +}; + +var_dump(array_walk($ar, $func, $user_data)); +echo "End result:"; +var_dump($user_data["sum"]); + +echo "\nclosure with use\n"; +$ar = ["one" => 1, "two"=>2, "three" => 3]; +$user_data = ["sum" => 42]; +$func = function($value, $key) use (&$user_data) { + var_dump($user_data); + $user_data["sum"] += $value; +}; + +var_dump(array_walk($ar, $func, $user_data)); +echo "End result:"; +var_dump($user_data["sum"]); + + +echo "\nclosure with object\n"; +$ar = ["one" => 1, "two"=>2, "three" => 3]; +$user_data = (object)["sum" => 42]; +$func = function($value, $key, &$udata) { + var_dump($udata); + $udata->sum += $value; +}; + +var_dump(array_walk($ar, $func, $user_data)); +echo "End result:"; +var_dump($user_data->sum); + + + +echo "\nfunction with object\n"; +function sum_it_up_object($value, $key, $udata) +{ + var_dump($udata); + $udata->sum += $value; +} + +$ar = ["one" => 1, "two"=>2, "three" => 3]; +$user_data = (object)["sum" => 42]; + +var_dump(array_walk($ar, "sum_it_up_object", $user_data)); +echo "End result:"; +var_dump($user_data->sum); + + +echo "\nfunction with array\n"; +function sum_it_up_array($value, $key, $udata) +{ + var_dump($udata); + $udata['sum'] += $value; +} + +$ar = ["one" => 1, "two"=>2, "three" => 3]; +$user_data = ["sum" => 42]; + +var_dump(array_walk($ar, "sum_it_up_array", $user_data)); +echo "End result:"; +var_dump($user_data['sum']); + +echo "\nclosure and exception\n"; +$ar = ["one" => 1, "two"=>2, "three" => 3]; +try { + var_dump(array_walk($ar, function($v, $k) { if ($v == 2) throw new Exception; } )); +} catch (Exception $e) { + var_dump($e->getTrace()); +} + + +echo "Done\n"; +?> +--EXPECTF-- +Warning: array_walk() expects at least 2 parameters, 0 given in %s on line %d +NULL + +Warning: array_walk() expects parameter 1 to be array, boolean given in %s on line %d +NULL + +Warning: array_walk() expects parameter 1 to be array, null given in %s on line %d +NULL +array(2) { + [0]=> + int(1) + [1]=> + string(3) "one" +} +array(2) { + [0]=> + int(2) + [1]=> + string(3) "two" +} +array(2) { + [0]=> + int(3) + [1]=> + string(5) "three" +} +bool(true) + +closure with array +array(1) { + ["sum"]=> + int(42) +} +array(1) { + ["sum"]=> + int(43) +} +array(1) { + ["sum"]=> + int(45) +} +bool(true) +End result:int(42) + +closure with use +array(1) { + ["sum"]=> + int(42) +} +array(1) { + ["sum"]=> + int(43) +} +array(1) { + ["sum"]=> + int(45) +} +bool(true) +End result:int(48) + +closure with object +object(stdClass)#1 (1) { + ["sum"]=> + int(42) +} +object(stdClass)#1 (1) { + ["sum"]=> + int(43) +} +object(stdClass)#1 (1) { + ["sum"]=> + int(45) +} +bool(true) +End result:int(48) + +function with object +object(stdClass)#2 (1) { + ["sum"]=> + int(42) +} +object(stdClass)#2 (1) { + ["sum"]=> + int(43) +} +object(stdClass)#2 (1) { + ["sum"]=> + int(45) +} +bool(true) +End result:int(48) + +function with array +array(1) { + ["sum"]=> + int(42) +} +array(1) { + ["sum"]=> + int(42) +} +array(1) { + ["sum"]=> + int(42) +} +bool(true) +End result:int(42) + +closure and exception +array(2) { + [0]=> + array(2) { + ["function"]=> + string(9) "{closure}" + ["args"]=> + array(2) { + [0]=> + int(2) + [1]=> + string(3) "two" + } + } + [1]=> + array(4) { + ["file"]=> + string(%d) "%s" + ["line"]=> + int(%d) + ["function"]=> + string(10) "array_walk" + ["args"]=> + array(2) { + [0]=> + &array(3) { + ["one"]=> + int(1) + ["two"]=> + int(2) + ["three"]=> + int(3) + } + [1]=> + object(Closure)#2 (1) { + ["parameter"]=> + array(2) { + ["$v"]=> + string(10) "<required>" + ["$k"]=> + string(10) "<required>" + } + } + } + } +} +Done diff --git a/ext/standard/tests/array/array_walk_error2.phpt b/ext/standard/tests/array/array_walk_error2.phpt index 654637ab5..63c5f51ee 100644 --- a/ext/standard/tests/array/array_walk_error2.phpt +++ b/ext/standard/tests/array/array_walk_error2.phpt @@ -25,7 +25,7 @@ echo "*** Testing array_walk() : error conditions - callback parameters ***\n"; var_dump( array_walk($input, "callback1") ); var_dump( array_walk($input, "callback2", 4) ); -// expected: Warning is supressed +// expected: Warning is suppressed var_dump( @array_walk($input, "callback1") ); var_dump( @array_walk($input, "callback2", 4) ); diff --git a/ext/standard/tests/array/array_walk_recursive_basic2.phpt b/ext/standard/tests/array/array_walk_recursive_basic2.phpt index c71d92b45..a049c0b81 100644 --- a/ext/standard/tests/array/array_walk_recursive_basic2.phpt +++ b/ext/standard/tests/array/array_walk_recursive_basic2.phpt @@ -25,7 +25,7 @@ function test_alter(&$item, $key, $prefix) // with proper type var_dump($item); // value var_dump($key); // key - var_dump($prefix); // additional agument passed to callback function + var_dump($prefix); // additional argument passed to callback function echo "\n"; // new line to separate the output between each element } diff --git a/ext/standard/tests/array/array_walk_recursive_error2.phpt b/ext/standard/tests/array/array_walk_recursive_error2.phpt index d628e9327..8e0c8829e 100644 --- a/ext/standard/tests/array/array_walk_recursive_error2.phpt +++ b/ext/standard/tests/array/array_walk_recursive_error2.phpt @@ -25,7 +25,7 @@ echo "*** Testing array_walk_recursive() : error conditions - callback parameter var_dump( array_walk_recursive($input, "callback1") ); var_dump( array_walk_recursive($input, "callback2", 4) ); -// expected: Warning is supressed +// expected: Warning is suppressed var_dump( @array_walk_recursive($input, "callback1") ); var_dump( @array_walk_recursive($input, "callback2", 4) ); diff --git a/ext/standard/tests/array/arsort_variation1.phpt b/ext/standard/tests/array/arsort_variation1.phpt index 1545abe34..bff8d4130 100644 --- a/ext/standard/tests/array/arsort_variation1.phpt +++ b/ext/standard/tests/array/arsort_variation1.phpt @@ -74,7 +74,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of arsort() -// when $array arugment is supplied with different values from $unexpected_values +// when $array argument is supplied with different values from $unexpected_values echo "\n-- Testing arsort() by supplying different unexpected values for 'array' argument --\n"; echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n"; diff --git a/ext/standard/tests/array/arsort_variation2.phpt b/ext/standard/tests/array/arsort_variation2.phpt index b85653052..ddfe319a4 100644 --- a/ext/standard/tests/array/arsort_variation2.phpt +++ b/ext/standard/tests/array/arsort_variation2.phpt @@ -70,7 +70,7 @@ $unexpected_values = array( ); // loop though each element of the array and check the working of arsort() -// when $flag arugment is supplied with different values from $unexpected_values +// when $flag argument is supplied with different values from $unexpected_values echo "\n-- Testing arsort() by supplying different unexpected values for 'sort_flags' argument --\n"; $counter = 1; diff --git a/ext/standard/tests/array/asort_variation1.phpt b/ext/standard/tests/array/asort_variation1.phpt index 5420f0524..67eb5bf21 100644 --- a/ext/standard/tests/array/asort_variation1.phpt +++ b/ext/standard/tests/array/asort_variation1.phpt @@ -74,7 +74,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of asort() -// when $array arugment is supplied with different values from $unexpected_values +// when $array argument is supplied with different values from $unexpected_values echo "\n-- Testing asort() by supplying different unexpected values for 'array' argument --\n"; echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n"; diff --git a/ext/standard/tests/array/asort_variation2.phpt b/ext/standard/tests/array/asort_variation2.phpt index 6cce64433..138e12453 100644 --- a/ext/standard/tests/array/asort_variation2.phpt +++ b/ext/standard/tests/array/asort_variation2.phpt @@ -70,7 +70,7 @@ $unexpected_values = array( ); // loop though each element of the array and check the working of asort() -// when $flag arugment is supplied with different values from $unexpected_values +// when $flag argument is supplied with different values from $unexpected_values echo "\n-- Testing asort() by supplying different unexpected values for 'sort_flags' argument --\n"; $counter = 1; diff --git a/ext/standard/tests/array/bug31158.phpt b/ext/standard/tests/array/bug31158.phpt index e672a10b2..da7a9ec90 100644 --- a/ext/standard/tests/array/bug31158.phpt +++ b/ext/standard/tests/array/bug31158.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #31158 (array_splice on $GLOBALS crashes) +--INI-- +error_reporting = E_ALL --FILE-- <?php function __(){ diff --git a/ext/standard/tests/array/bug34066.phpt b/ext/standard/tests/array/bug34066.phpt index 31f6b4c1d..023f4176f 100644 --- a/ext/standard/tests/array/bug34066.phpt +++ b/ext/standard/tests/array/bug34066.phpt @@ -123,7 +123,7 @@ Bug #34066 (recursive array_walk causes segfault) "ProceedKeyArticle" => "01", "ActionKey" => "00", "ContactCommissionArticle"=> "0,00", - "QuantDependantPriceKey"=> "", + "QuantdependentPriceKey"=> "", "Quant" => "1", "QuantUnit" => "", "Meas" => array( @@ -584,7 +584,7 @@ gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) /Docs/Doc/DocItems/DocItem/ContactCommissionArticle=0,00 gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) -/Docs/Doc/DocItems/DocItem/QuantDependantPriceKey +/Docs/Doc/DocItems/DocItem/QuantdependentPriceKey gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) /Docs/Doc/DocItems/DocItem/Quant=1 diff --git a/ext/standard/tests/array/bug34066_1.phpt b/ext/standard/tests/array/bug34066_1.phpt index edc16efd0..6d0f7f84e 100644 --- a/ext/standard/tests/array/bug34066_1.phpt +++ b/ext/standard/tests/array/bug34066_1.phpt @@ -123,7 +123,7 @@ Bug #34066 (recursive array_walk causes segfault) "ProceedKeyArticle" => "01", "ActionKey" => "00", "ContactCommissionArticle"=> "0,00", - "QuantDependantPriceKey"=> "", + "QuantdependentPriceKey"=> "", "Quant" => "1", "QuantUnit" => "", "Meas" => array( @@ -543,7 +543,7 @@ gen_xml(prefix=/Docs/) /Docs/ContactCommissionArticle=0,00 gen_xml(prefix=/Docs/) end gen_xml(prefix=/Docs/) -/Docs/QuantDependantPriceKey +/Docs/QuantdependentPriceKey gen_xml(prefix=/Docs/) end gen_xml(prefix=/Docs/) /Docs/Quant=1 diff --git a/ext/standard/tests/array/bug40709.phpt b/ext/standard/tests/array/bug40709.phpt index eb0c71200..7e132ba3d 100644 --- a/ext/standard/tests/array/bug40709.phpt +++ b/ext/standard/tests/array/bug40709.phpt @@ -2,7 +2,7 @@ Bug #40709 (array_reduce() behaves strange with one item stored arrays) --FILE-- <?php -function CommaSeperatedList($a, $b) { +function CommaSeparatedList($a, $b) { if($a == null) return $b; else @@ -12,10 +12,10 @@ function CommaSeperatedList($a, $b) { $arr1 = array(1,2,3); $arr2 = array(1); -echo "result for arr1: ".array_reduce($arr1,'CommaSeperatedList')."\n"; -echo "result for arr2: ".array_reduce($arr2,'CommaSeperatedList')."\n"; -echo "result for arr1: ".array_reduce($arr1,'CommaSeperatedList')."\n"; -echo "result for arr2: ".array_reduce($arr2,'CommaSeperatedList')."\n"; +echo "result for arr1: ".array_reduce($arr1,'CommaSeparatedList')."\n"; +echo "result for arr2: ".array_reduce($arr2,'CommaSeparatedList')."\n"; +echo "result for arr1: ".array_reduce($arr1,'CommaSeparatedList')."\n"; +echo "result for arr2: ".array_reduce($arr2,'CommaSeparatedList')."\n"; echo "Done\n"; ?> diff --git a/ext/standard/tests/array/bug65304.phpt b/ext/standard/tests/array/bug65304.phpt new file mode 100644 index 000000000..e5c9dfc5e --- /dev/null +++ b/ext/standard/tests/array/bug65304.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #65304 (Use of max int in array_sum) +--FILE-- +<?php +var_dump(array_sum(array(PHP_INT_MAX, 1))); +var_dump(PHP_INT_MAX + 1); +?> +--EXPECTF-- +float(%s) +float(%s) diff --git a/ext/standard/tests/array/in_array_variation4.phpt b/ext/standard/tests/array/in_array_variation4.phpt index b88a5a2d6..a27bb196b 100644 --- a/ext/standard/tests/array/in_array_variation4.phpt +++ b/ext/standard/tests/array/in_array_variation4.phpt @@ -19,7 +19,7 @@ $file_handle = fopen(__FILE__, "r"); //directory type resource $dir_handle = opendir( dirname(__FILE__) ); -//store resources in array for comparision. +//store resources in array for comparison. $resources = array($file_handle, $dir_handle); // search for resouce type in the resource array diff --git a/ext/standard/tests/array/krsort_variation1.phpt b/ext/standard/tests/array/krsort_variation1.phpt index e4cbaf8d2..fa13242a0 100644 --- a/ext/standard/tests/array/krsort_variation1.phpt +++ b/ext/standard/tests/array/krsort_variation1.phpt @@ -72,7 +72,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of krsort() -// when $array arugment is supplied with different values from $unexpected_values +// when $array argument is supplied with different values from $unexpected_values echo "\n-- Testing krsort() by supplying different unexpected values for 'array' argument --\n"; echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n"; diff --git a/ext/standard/tests/array/krsort_variation2.phpt b/ext/standard/tests/array/krsort_variation2.phpt index 137620247..d193589de 100644 --- a/ext/standard/tests/array/krsort_variation2.phpt +++ b/ext/standard/tests/array/krsort_variation2.phpt @@ -69,7 +69,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of krsort() -// when 'sort_flags' arugment is supplied with different values +// when 'sort_flags' argument is supplied with different values echo "\n-- Testing krsort() by supplying different unexpected values for 'sort_flags' argument --\n"; $counter = 1; diff --git a/ext/standard/tests/array/ksort_variation1.phpt b/ext/standard/tests/array/ksort_variation1.phpt index d8c037fa9..37a35d1c0 100644 --- a/ext/standard/tests/array/ksort_variation1.phpt +++ b/ext/standard/tests/array/ksort_variation1.phpt @@ -72,7 +72,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of ksort() -// when $array arugment is supplied with different values from $unexpected_values +// when $array argument is supplied with different values from $unexpected_values echo "\n-- Testing ksort() by supplying different unexpected values for 'array' argument --\n"; echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n"; diff --git a/ext/standard/tests/array/ksort_variation2.phpt b/ext/standard/tests/array/ksort_variation2.phpt index 4969844e7..102c1c1eb 100644 --- a/ext/standard/tests/array/ksort_variation2.phpt +++ b/ext/standard/tests/array/ksort_variation2.phpt @@ -69,7 +69,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of ksort() -// when 'sort_flags' arugment is supplied with different values +// when 'sort_flags' argument is supplied with different values echo "\n-- Testing ksort() by supplying different unexpected values for 'sort_flags' argument --\n"; $counter = 1; diff --git a/ext/standard/tests/array/sizeof_basic2.phpt b/ext/standard/tests/array/sizeof_basic2.phpt index a2ab2eedf..b56682c31 100644 --- a/ext/standard/tests/array/sizeof_basic2.phpt +++ b/ext/standard/tests/array/sizeof_basic2.phpt @@ -19,7 +19,7 @@ echo "*** Testing sizeof() : basic functionality ***\n"; $int_array = array(1, 2, 3, 4); $string_array = array("Saffron", "White", "Green"); -$indexed_array = array("Agression" => "Saffron", "Peace" => "White", "Growth" => "Green"); +$indexed_array = array("Aggression" => "Saffron", "Peace" => "White", "Growth" => "Green"); $mixed_array = array(1, 2, "Aggression" => "Saffron", 10 => "Ten", "Ten" => 10); echo "-- Testing sizeof() with integer array in default, COUNT_NORMAL, COUNT_RECURSIVE modes --\n"; diff --git a/ext/standard/tests/array/sizeof_variation4.phpt b/ext/standard/tests/array/sizeof_variation4.phpt index a2462757d..cb8fecc82 100644 --- a/ext/standard/tests/array/sizeof_variation4.phpt +++ b/ext/standard/tests/array/sizeof_variation4.phpt @@ -54,7 +54,7 @@ $values = array ( /* 20 */ $fp ); -// loop through the each element of the $values array for 'var' arugment +// loop through the each element of the $values array for 'var' argument // and check the functionality of sizeof() $counter = 1; foreach($values as $value) diff --git a/ext/standard/tests/array/sort_variation1.phpt b/ext/standard/tests/array/sort_variation1.phpt index f6991bdf6..9243de08e 100644 --- a/ext/standard/tests/array/sort_variation1.phpt +++ b/ext/standard/tests/array/sort_variation1.phpt @@ -73,7 +73,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of sort() -// when $array arugment is supplied with different values from $unexpected_values +// when $array argument is supplied with different values from $unexpected_values echo "\n-- Testing sort() by supplying different unexpected values for 'array' argument --\n"; echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n"; diff --git a/ext/standard/tests/array/sort_variation2.phpt b/ext/standard/tests/array/sort_variation2.phpt index 7cb8ed642..af3deba4b 100644 --- a/ext/standard/tests/array/sort_variation2.phpt +++ b/ext/standard/tests/array/sort_variation2.phpt @@ -69,7 +69,7 @@ $unexpected_values = array( ); // loop though each element of the array and check the working of sort() -// when $flag arugment is supplied with different values +// when $flag argument is supplied with different values echo "\n-- Testing sort() by supplying different unexpected values for 'flag' argument --\n"; $counter = 1; diff --git a/ext/standard/tests/array/uasort_error.phpt b/ext/standard/tests/array/uasort_error.phpt index 820ab5847..cc2dd3a21 100644 --- a/ext/standard/tests/array/uasort_error.phpt +++ b/ext/standard/tests/array/uasort_error.phpt @@ -50,7 +50,7 @@ var_dump( uasort($array_arg) ); echo "-- Testing uasort() function with non-existent compare function --\n"; var_dump( uasort($array_arg, 'non_existent') ); -// With non existent comparison function and extra arguemnt +// With non existent comparison function and extra argument echo "-- Testing uasort() function with non-existent compare function and extra argument --\n"; var_dump( uasort($array_arg, 'non_existent', $extra_arg) ); diff --git a/ext/standard/tests/array/uasort_object2.phpt b/ext/standard/tests/array/uasort_object2.phpt index cd32d8d94..889db9886 100644 --- a/ext/standard/tests/array/uasort_object2.phpt +++ b/ext/standard/tests/array/uasort_object2.phpt @@ -8,7 +8,7 @@ Test uasort() function : object functionality - sort diff. objects * /* - * This testcase tests uasort() functionality with differnt objects + * This testcase tests uasort() functionality with different objects * Objects of different classes: * simple class, * child class, diff --git a/ext/standard/tests/array/uasort_variation10.phpt b/ext/standard/tests/array/uasort_variation10.phpt index 809cb78f5..e0c5e72f7 100644 --- a/ext/standard/tests/array/uasort_variation10.phpt +++ b/ext/standard/tests/array/uasort_variation10.phpt @@ -11,7 +11,7 @@ Test uasort() function : usage variations - sort array with reference variables * Testing uasort() with 'array_arg' containing different reference variables */ -// comparision function +// comparison function /* Prototype : int cmp_function(mixed $value1, mixed $value2) * Parameters : $value1 and $value2 - values to be compared * Return value : 0 - if both values are same diff --git a/ext/standard/tests/array/uasort_variation4.phpt b/ext/standard/tests/array/uasort_variation4.phpt index c2844bfd2..0ed797fb8 100644 --- a/ext/standard/tests/array/uasort_variation4.phpt +++ b/ext/standard/tests/array/uasort_variation4.phpt @@ -12,7 +12,7 @@ Test uasort() function : usage variations - sort different numeric values * integer, octal, hexadecimal & float */ -// comparision function +// comparison function /* Prototype : int cmp_function(mixed $value1, mixed $value2) * Parameters : $value1 and $value2 - values to be compared * Return value : 0 - if both values are same diff --git a/ext/standard/tests/array/usort_error2.phpt b/ext/standard/tests/array/usort_error2.phpt index 308199fc1..7bf0f659e 100644 --- a/ext/standard/tests/array/usort_error2.phpt +++ b/ext/standard/tests/array/usort_error2.phpt @@ -36,7 +36,7 @@ $extra_arg = 10; echo "\n-- Testing usort() function with non-existent compare function --\n"; var_dump( usort($array_arg, 'non_existent') ); -// With non existent comparison function and extra arguemnt +// With non existent comparison function and extra argument echo "\n-- Testing usort() function with non-existent compare function and extra argument --\n"; var_dump( usort($array_arg, 'non_existent', $extra_arg) ); ?> diff --git a/ext/standard/tests/class_object/class_exists_variation_001.phpt b/ext/standard/tests/class_object/class_exists_variation_001.phpt index c9146ba9f..52a358476 100644 --- a/ext/standard/tests/class_object/class_exists_variation_001.phpt +++ b/ext/standard/tests/class_object/class_exists_variation_001.phpt @@ -1,5 +1,5 @@ --TEST-- -Test class_exists() function : usage variations - unexpected types for agument 1 +Test class_exists() function : usage variations - unexpected types for argument 1 --FILE-- <?php /* Prototype : proto bool class_exists(string classname [, bool autoload]) diff --git a/ext/standard/tests/class_object/class_exists_variation_002.phpt b/ext/standard/tests/class_object/class_exists_variation_002.phpt index ae9de157f..954e4d8cb 100644 --- a/ext/standard/tests/class_object/class_exists_variation_002.phpt +++ b/ext/standard/tests/class_object/class_exists_variation_002.phpt @@ -1,5 +1,5 @@ --TEST-- -Test class_exists() function : usage variations - unexpected types for agument 2 +Test class_exists() function : usage variations - unexpected types for argument 2 --FILE-- <?php /* Prototype : proto bool class_exists(string classname [, bool autoload]) diff --git a/ext/standard/tests/class_object/trait_exists_variation_001.phpt b/ext/standard/tests/class_object/trait_exists_variation_001.phpt index 65ef1993c..e7fa4afd1 100644 --- a/ext/standard/tests/class_object/trait_exists_variation_001.phpt +++ b/ext/standard/tests/class_object/trait_exists_variation_001.phpt @@ -1,5 +1,5 @@ --TEST-- -Test trait_exists() function : usage variations - unexpected types for agument 1 +Test trait_exists() function : usage variations - unexpected types for argument 1 --FILE-- <?php /* Prototype : proto bool trait_exists(string traitname [, bool autoload]) diff --git a/ext/standard/tests/class_object/trait_exists_variation_002.phpt b/ext/standard/tests/class_object/trait_exists_variation_002.phpt index a2fcbbf01..365efffe4 100644 --- a/ext/standard/tests/class_object/trait_exists_variation_002.phpt +++ b/ext/standard/tests/class_object/trait_exists_variation_002.phpt @@ -1,5 +1,5 @@ --TEST-- -Test trait_exists() function : usage variations - unexpected types for agument 2 +Test trait_exists() function : usage variations - unexpected types for argument 2 --FILE-- <?php /* Prototype : proto bool trait_exists(string traitname [, bool autoload]) diff --git a/ext/standard/tests/file/005_error.phpt b/ext/standard/tests/file/005_error.phpt index fc4852e4a..20ba3a7fc 100644 --- a/ext/standard/tests/file/005_error.phpt +++ b/ext/standard/tests/file/005_error.phpt @@ -23,7 +23,7 @@ Test fileatime(), filemtime(), filectime() & touch() functions : error condition echo "*** Testing error conditions ***\n"; echo "\n-- Testing with Non-existing files --"; -/* Both invalid argumetns */ +/* Both invalid arguments */ var_dump( fileatime("/no/such/file/or/dir") ); var_dump( filemtime("/no/such/file/or/dir") ); var_dump( filectime("/no/such/file/or/dir") ); diff --git a/ext/standard/tests/file/007_variation10.phpt b/ext/standard/tests/file/007_variation10.phpt index c9f3e01cf..2981ef7d4 100644 --- a/ext/standard/tests/file/007_variation10.phpt +++ b/ext/standard/tests/file/007_variation10.phpt @@ -30,7 +30,7 @@ echo "*** Test fopen() & fclose() functions: with 'r+t' mode ***\n"; $file_handle = fopen($file, "r+t"); //opening the file in "r+t" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fread($file_handle, 100) ); //Check for read operation var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the end of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string diff --git a/ext/standard/tests/file/007_variation11-win32.phpt b/ext/standard/tests/file/007_variation11-win32.phpt index d9c6e83d4..a567b72b0 100644 --- a/ext/standard/tests/file/007_variation11-win32.phpt +++ b/ext/standard/tests/file/007_variation11-win32.phpt @@ -36,12 +36,12 @@ echo "*** Test fopen() & fclose() functions: with 'wt' mode ***\n"; $file_handle = fopen($file, "wt"); //opening the file "wt" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string -var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file +var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file var_dump( fclose($file_handle) ); //Check for close operation on the file handle var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation @@ -53,7 +53,7 @@ clearstatcache(); unlink($file); //Deleting the file fclose( fopen($file, "wt") ); //Opening the non-existing file in "wt" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation11.phpt b/ext/standard/tests/file/007_variation11.phpt index 0656c6460..c884f47f4 100644 --- a/ext/standard/tests/file/007_variation11.phpt +++ b/ext/standard/tests/file/007_variation11.phpt @@ -36,12 +36,12 @@ echo "*** Test fopen() & fclose() functions: with 'wt' mode ***\n"; $file_handle = fopen($file, "wt"); //opening the file "wt" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string -var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file +var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file var_dump( fclose($file_handle) ); //Check for close operation on the file handle var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation @@ -53,7 +53,7 @@ clearstatcache(); unlink($file); //Deleting the file fclose( fopen($file, "wt") ); //Opening the non-existing file in "wt" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation12-win32.phpt b/ext/standard/tests/file/007_variation12-win32.phpt index 0fb9ad8df..d3d26e299 100644 --- a/ext/standard/tests/file/007_variation12-win32.phpt +++ b/ext/standard/tests/file/007_variation12-win32.phpt @@ -36,7 +36,7 @@ echo "*** Test fopen() & fclose() functions: with 'w+t' mode ***\n"; $file_handle = fopen($file, "w+t"); //opening the file "w+t" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); @@ -53,7 +53,7 @@ clearstatcache(); unlink($file); //Deleting the file fclose( fopen($file, "w+t") ); //Opening the non-existing file in "w+t" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation12.phpt b/ext/standard/tests/file/007_variation12.phpt index 44488fa21..c56605ac6 100644 --- a/ext/standard/tests/file/007_variation12.phpt +++ b/ext/standard/tests/file/007_variation12.phpt @@ -36,7 +36,7 @@ echo "*** Test fopen() & fclose() functions: with 'w+t' mode ***\n"; $file_handle = fopen($file, "w+t"); //opening the file "w+t" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); @@ -53,7 +53,7 @@ clearstatcache(); unlink($file); //Deleting the file fclose( fopen($file, "w+t") ); //Opening the non-existing file in "w+t" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation13-win32.phpt b/ext/standard/tests/file/007_variation13-win32.phpt index 736b10104..fabcde90c 100644 --- a/ext/standard/tests/file/007_variation13-win32.phpt +++ b/ext/standard/tests/file/007_variation13-win32.phpt @@ -45,7 +45,7 @@ var_dump( filesize($file) ); //Check that data hasn't over written; Expected: Si unlink($file); //Deleting the file fclose( fopen($file, "at") ); //Opening the non-existing file in "at" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation13.phpt b/ext/standard/tests/file/007_variation13.phpt index 0cb48d366..9d3e6265b 100644 --- a/ext/standard/tests/file/007_variation13.phpt +++ b/ext/standard/tests/file/007_variation13.phpt @@ -45,7 +45,7 @@ var_dump( filesize($file) ); //Check that data hasn't over written; Expected: Si unlink($file); //Deleting the file fclose( fopen($file, "at") ); //Opening the non-existing file in "at" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation14.phpt b/ext/standard/tests/file/007_variation14.phpt index ed76ab483..ebcad6d83 100644 --- a/ext/standard/tests/file/007_variation14.phpt +++ b/ext/standard/tests/file/007_variation14.phpt @@ -39,7 +39,7 @@ var_dump( get_resource_type($file_handle) ); //Check whether resource is lost a unlink($file); //Deleting the file fclose( fopen($file, "a+t") ); //Opening the non-existing file in "a+t" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation15.phpt b/ext/standard/tests/file/007_variation15.phpt index 11eed0d5a..1a2d530b6 100644 --- a/ext/standard/tests/file/007_variation15.phpt +++ b/ext/standard/tests/file/007_variation15.phpt @@ -28,12 +28,12 @@ echo "*** Test fopen() & fclose() functions: with 'xt' mode ***\n"; $file_handle = fopen($file, "xt"); //opening the non-existing file in "xt" mode, file will be created var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string -var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file +var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file var_dump( fclose($file_handle) ); //Check for close operation on the file handle var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation $file_handle = fopen($file, "xt"); //Opening the existing data file in 'xt' mode to check for the warning message diff --git a/ext/standard/tests/file/007_variation16.phpt b/ext/standard/tests/file/007_variation16.phpt index c725aa183..633299ded 100644 --- a/ext/standard/tests/file/007_variation16.phpt +++ b/ext/standard/tests/file/007_variation16.phpt @@ -28,7 +28,7 @@ echo "*** Test fopen() & fclose() functions: with 'x+t' mode ***\n"; $file_handle = fopen($file, "x+t"); //opening the non-existing file in "x+t" mode, file will be created var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); diff --git a/ext/standard/tests/file/007_variation18.phpt b/ext/standard/tests/file/007_variation18.phpt index 991051d5e..88350b842 100644 --- a/ext/standard/tests/file/007_variation18.phpt +++ b/ext/standard/tests/file/007_variation18.phpt @@ -30,7 +30,7 @@ echo "*** Test fopen() & fclose() functions: with 'r+b' mode ***\n"; $file_handle = fopen($file, "r+b"); //opening the file in "r+b" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fread($file_handle, 100) ); //Check for read operation var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the end of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string diff --git a/ext/standard/tests/file/007_variation19.phpt b/ext/standard/tests/file/007_variation19.phpt index 3830e4fc2..0731d454b 100644 --- a/ext/standard/tests/file/007_variation19.phpt +++ b/ext/standard/tests/file/007_variation19.phpt @@ -31,12 +31,12 @@ echo "*** Test fopen() & fclose() functions: with 'wb' mode ***\n"; $file_handle = fopen($file, "wb"); //opening the file "wb" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string -var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file +var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file var_dump( fclose($file_handle) ); //Check for close operation on the file handle var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation @@ -48,7 +48,7 @@ clearstatcache(); unlink($file); //Deleting the file fclose( fopen($file, "wb") ); //Opening the non-existing file in "wb" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation2.phpt b/ext/standard/tests/file/007_variation2.phpt index 4c883ea32..deb51266e 100644 --- a/ext/standard/tests/file/007_variation2.phpt +++ b/ext/standard/tests/file/007_variation2.phpt @@ -30,7 +30,7 @@ echo "*** Test fopen() & fclose() functions: with 'r+' mode ***\n"; $file_handle = fopen($file, "r+"); //opening the file in "r+" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fread($file_handle, 100) ); //Check for read operation var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the end of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string diff --git a/ext/standard/tests/file/007_variation20.phpt b/ext/standard/tests/file/007_variation20.phpt index 4d66dc7ee..3eddec425 100644 --- a/ext/standard/tests/file/007_variation20.phpt +++ b/ext/standard/tests/file/007_variation20.phpt @@ -31,7 +31,7 @@ echo "*** Test fopen() & fclose() functions: with 'w+b' mode ***\n"; $file_handle = fopen($file, "w+b"); //opening the file "w+b" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); @@ -48,7 +48,7 @@ clearstatcache(); unlink($file); //Deleting the file fclose( fopen($file, "w+b") ); //Opening the non-existing file in "w+b" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation21.phpt b/ext/standard/tests/file/007_variation21.phpt index 6c968f229..c70aaad78 100644 --- a/ext/standard/tests/file/007_variation21.phpt +++ b/ext/standard/tests/file/007_variation21.phpt @@ -40,7 +40,7 @@ var_dump( filesize($file) ); //Check that data hasn't over written; Expected: Si unlink($file); //Deleting the file fclose( fopen($file, "ab") ); //Opening the non-existing file in "ab" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation22.phpt b/ext/standard/tests/file/007_variation22.phpt index d1456fe26..63deee4f8 100644 --- a/ext/standard/tests/file/007_variation22.phpt +++ b/ext/standard/tests/file/007_variation22.phpt @@ -39,7 +39,7 @@ var_dump( get_resource_type($file_handle) ); //Check whether resource is lost a unlink($file); //Deleting the file fclose( fopen($file, "a+b") ); //Opening the non-existing file in "a+b" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation23.phpt b/ext/standard/tests/file/007_variation23.phpt index 528f05a86..1826296a0 100644 --- a/ext/standard/tests/file/007_variation23.phpt +++ b/ext/standard/tests/file/007_variation23.phpt @@ -28,12 +28,12 @@ echo "*** Test fopen() & fclose() functions: with 'xb' mode ***\n"; $file_handle = fopen($file, "xb"); //opening the non-existing file in "xb" mode, file will be created var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string -var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file +var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file var_dump( fclose($file_handle) ); //Check for close operation on the file handle var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation $file_handle = fopen($file, "xb"); //Opening the existing data file in 'xb' mode to check for the warning message diff --git a/ext/standard/tests/file/007_variation24.phpt b/ext/standard/tests/file/007_variation24.phpt index 41fc24cbe..d898ba7b5 100644 --- a/ext/standard/tests/file/007_variation24.phpt +++ b/ext/standard/tests/file/007_variation24.phpt @@ -28,7 +28,7 @@ echo "*** Test fopen() & fclose() functions: with 'x+b' mode ***\n"; $file_handle = fopen($file, "x+b"); //opening the non-existing file in "x+b" mode, file will be created var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); diff --git a/ext/standard/tests/file/007_variation3.phpt b/ext/standard/tests/file/007_variation3.phpt index cd31eba1e..f4ae03658 100644 --- a/ext/standard/tests/file/007_variation3.phpt +++ b/ext/standard/tests/file/007_variation3.phpt @@ -31,12 +31,12 @@ echo "*** Test fopen() & fclose() functions: with 'w' mode ***\n"; $file_handle = fopen($file, "w"); //opening the file "w" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string -var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file +var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file var_dump( fclose($file_handle) ); //Check for close operation on the file handle var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation @@ -48,7 +48,7 @@ clearstatcache(); unlink($file); //Deleting the file fclose( fopen($file, "w") ); //Opening the non-existing file in "w" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation4.phpt b/ext/standard/tests/file/007_variation4.phpt index e88324e83..0dabc5b9a 100644 --- a/ext/standard/tests/file/007_variation4.phpt +++ b/ext/standard/tests/file/007_variation4.phpt @@ -31,7 +31,7 @@ echo "*** Test fopen() & fclose() functions: with 'w+' mode ***\n"; $file_handle = fopen($file, "w+"); //opening the file "w+" mode var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); @@ -48,7 +48,7 @@ clearstatcache(); unlink($file); //Deleting the file fclose( fopen($file, "w+") ); //Opening the non-existing file in "w+" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation5.phpt b/ext/standard/tests/file/007_variation5.phpt index 931153457..51e366d29 100644 --- a/ext/standard/tests/file/007_variation5.phpt +++ b/ext/standard/tests/file/007_variation5.phpt @@ -40,7 +40,7 @@ var_dump( filesize($file) ); //Check that data hasn't over written; Expected: Si unlink($file); //Deleting the file fclose( fopen($file, "a") ); //Opening the non-existing file in "a" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation6.phpt b/ext/standard/tests/file/007_variation6.phpt index b274b0592..92c017175 100644 --- a/ext/standard/tests/file/007_variation6.phpt +++ b/ext/standard/tests/file/007_variation6.phpt @@ -39,7 +39,7 @@ var_dump( get_resource_type($file_handle) ); //Check whether resource is lost a unlink($file); //Deleting the file fclose( fopen($file, "a+") ); //Opening the non-existing file in "a+" mode, which will be created -var_dump( file_exists($file) ); //Check for the existance of file +var_dump( file_exists($file) ); //Check for the existence of file echo "*** Done ***\n"; --CLEAN-- <?php diff --git a/ext/standard/tests/file/007_variation7.phpt b/ext/standard/tests/file/007_variation7.phpt index 131daff55..06bf9117f 100644 --- a/ext/standard/tests/file/007_variation7.phpt +++ b/ext/standard/tests/file/007_variation7.phpt @@ -28,12 +28,12 @@ echo "*** Test fopen() & fclose() functions: with 'x' mode ***\n"; $file_handle = fopen($file, "x"); //opening the non-existing file in "x" mode, file will be created var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string -var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file +var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file var_dump( fclose($file_handle) ); //Check for close operation on the file handle var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation $file_handle = fopen($file, "x"); //Opening the existing data file in 'x' mode to check for the warning message diff --git a/ext/standard/tests/file/007_variation8.phpt b/ext/standard/tests/file/007_variation8.phpt index aa847115c..fae693204 100644 --- a/ext/standard/tests/file/007_variation8.phpt +++ b/ext/standard/tests/file/007_variation8.phpt @@ -28,7 +28,7 @@ echo "*** Test fopen() & fclose() functions: with 'x+' mode ***\n"; $file_handle = fopen($file, "x+"); //opening the non-existing file in "x+" mode, file will be created var_dump($file_handle); //Check for the content of handle var_dump( get_resource_type($file_handle) ); //Check for the type of resource -var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file +var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file rewind($file_handle); diff --git a/ext/standard/tests/file/bug24482.phpt b/ext/standard/tests/file/bug24482.phpt index f545f1add..9d0568af3 100644 --- a/ext/standard/tests/file/bug24482.phpt +++ b/ext/standard/tests/file/bug24482.phpt @@ -8,6 +8,11 @@ if (!function_exists("glob")) { ?> --FILE-- <?php + +// run this test in ext/standard/tests (see bug #64714) +chdir(__DIR__); // ensure in ext/standard/tests/file +chdir('..'); // move up to ext/standard/tests + $globdirs = glob("*", GLOB_ONLYDIR); $dirs = array(); diff --git a/ext/standard/tests/file/bug41874.phpt b/ext/standard/tests/file/bug41874.phpt index 827f486d4..8cc1ce2e6 100644 --- a/ext/standard/tests/file/bug41874.phpt +++ b/ext/standard/tests/file/bug41874.phpt @@ -6,9 +6,9 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) die('skip windows only test'); ?> --FILE-- <?php -$result = exec('cd 1:\non_existant; dir nonexistant'); +$result = exec('cd 1:\non_existent; dir nonexistent'); echo "$result"; -system('cd 1:\non_existant; dir nonexistant'); +system('cd 1:\non_existent; dir nonexistent'); ?> --EXPECT-- The system cannot find the drive specified. diff --git a/ext/standard/tests/file/bug41874_2.phpt b/ext/standard/tests/file/bug41874_2.phpt index 5d7b7cad8..bf76a749f 100644 --- a/ext/standard/tests/file/bug41874_2.phpt +++ b/ext/standard/tests/file/bug41874_2.phpt @@ -10,7 +10,7 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) { ?> --FILE-- <?php -$result = exec('cd 1:\\non_existant; dir nonexistant'); +$result = exec('cd 1:\\non_existent; dir nonexistent'); echo "$result"; ?> --EXPECT-- diff --git a/ext/standard/tests/file/bug41874_3.phpt b/ext/standard/tests/file/bug41874_3.phpt index 4d7b139ad..05095c6f1 100644 --- a/ext/standard/tests/file/bug41874_3.phpt +++ b/ext/standard/tests/file/bug41874_3.phpt @@ -10,7 +10,7 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) { ?> --FILE-- <?php -system('cd 1:\\non_existant; dir nonexistant'); +system('cd 1:\\non_existent; dir nonexistent'); ?> --EXPECT-- The system cannot find the drive specified.
\ No newline at end of file diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt index 91976b04d..3a9f9c31a 100644 --- a/ext/standard/tests/file/bug52820.phpt +++ b/ext/standard/tests/file/bug52820.phpt @@ -1,5 +1,5 @@ --TEST--
-Bug #52820 (writes to fopencookie FILE* not commited when seeking the stream)
+Bug #52820 (writes to fopencookie FILE* not committed when seeking the stream)
--SKIPIF--
<?php
if (!function_exists('leak_variable'))
diff --git a/ext/standard/tests/file/chmod_basic-win32.phpt b/ext/standard/tests/file/chmod_basic-win32.phpt index ca224f7d1..31d44c80a 100644 --- a/ext/standard/tests/file/chmod_basic-win32.phpt +++ b/ext/standard/tests/file/chmod_basic-win32.phpt @@ -1,5 +1,5 @@ --TEST-- -chmod() basic fuctionality +chmod() basic functionality --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) != 'WIN') { diff --git a/ext/standard/tests/file/chmod_basic.phpt b/ext/standard/tests/file/chmod_basic.phpt index 582f273d4..fc983074f 100644 --- a/ext/standard/tests/file/chmod_basic.phpt +++ b/ext/standard/tests/file/chmod_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -chmod() basic fuctionality +chmod() basic functionality --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) == 'WIN') { diff --git a/ext/standard/tests/file/fgetc_variation3.phpt b/ext/standard/tests/file/fgetc_variation3.phpt index f8349989a..64efaa6cf 100644 --- a/ext/standard/tests/file/fgetc_variation3.phpt +++ b/ext/standard/tests/file/fgetc_variation3.phpt @@ -30,7 +30,7 @@ foreach ($file_modes as $file_mode ) { $data = "fgetc_variation test"; fwrite($file_handle, $data); - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); diff --git a/ext/standard/tests/file/fgetc_variation4.phpt b/ext/standard/tests/file/fgetc_variation4.phpt index a2bc9e524..cb6f0cdce 100644 --- a/ext/standard/tests/file/fgetc_variation4.phpt +++ b/ext/standard/tests/file/fgetc_variation4.phpt @@ -29,7 +29,7 @@ foreach ($file_modes as $file_mode ) { $data = "fgetc\n test"; fwrite($file_handle, $data); - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); diff --git a/ext/standard/tests/file/fgetcsv_variation1.phpt b/ext/standard/tests/file/fgetcsv_variation1.phpt index 8a698e40a..969c9c034 100644 --- a/ext/standard/tests/file/fgetcsv_variation1.phpt +++ b/ext/standard/tests/file/fgetcsv_variation1.phpt @@ -59,7 +59,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation10.phpt b/ext/standard/tests/file/fgetcsv_variation10.phpt index 250237c21..60a401bb8 100644 --- a/ext/standard/tests/file/fgetcsv_variation10.phpt +++ b/ext/standard/tests/file/fgetcsv_variation10.phpt @@ -58,7 +58,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation11.phpt b/ext/standard/tests/file/fgetcsv_variation11.phpt index 815ede6f0..d5741248f 100644 --- a/ext/standard/tests/file/fgetcsv_variation11.phpt +++ b/ext/standard/tests/file/fgetcsv_variation11.phpt @@ -59,7 +59,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation12.phpt b/ext/standard/tests/file/fgetcsv_variation12.phpt index e513fe676..316868446 100644 --- a/ext/standard/tests/file/fgetcsv_variation12.phpt +++ b/ext/standard/tests/file/fgetcsv_variation12.phpt @@ -57,7 +57,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation13.phpt b/ext/standard/tests/file/fgetcsv_variation13.phpt index a00405b90..f191a2637 100644 --- a/ext/standard/tests/file/fgetcsv_variation13.phpt +++ b/ext/standard/tests/file/fgetcsv_variation13.phpt @@ -37,7 +37,7 @@ $loop_counter = 1; fwrite($file_handle, "This is line of text without csv fields\n"); // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation14.phpt b/ext/standard/tests/file/fgetcsv_variation14.phpt index 927bf8a07..14c72a24b 100644 --- a/ext/standard/tests/file/fgetcsv_variation14.phpt +++ b/ext/standard/tests/file/fgetcsv_variation14.phpt @@ -36,7 +36,7 @@ $loop_counter = 1; fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation15.phpt b/ext/standard/tests/file/fgetcsv_variation15.phpt index b36b88ed3..c6859497e 100644 --- a/ext/standard/tests/file/fgetcsv_variation15.phpt +++ b/ext/standard/tests/file/fgetcsv_variation15.phpt @@ -53,7 +53,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation16.phpt b/ext/standard/tests/file/fgetcsv_variation16.phpt index 904c42242..9cfdd7246 100644 --- a/ext/standard/tests/file/fgetcsv_variation16.phpt +++ b/ext/standard/tests/file/fgetcsv_variation16.phpt @@ -55,7 +55,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation17.phpt b/ext/standard/tests/file/fgetcsv_variation17.phpt index a54f8da61..b8d918659 100644 --- a/ext/standard/tests/file/fgetcsv_variation17.phpt +++ b/ext/standard/tests/file/fgetcsv_variation17.phpt @@ -55,7 +55,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation18.phpt b/ext/standard/tests/file/fgetcsv_variation18.phpt index 19915e816..f0ebcb7fa 100644 --- a/ext/standard/tests/file/fgetcsv_variation18.phpt +++ b/ext/standard/tests/file/fgetcsv_variation18.phpt @@ -55,7 +55,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation19.phpt b/ext/standard/tests/file/fgetcsv_variation19.phpt index 2e282e170..cb510099b 100644 --- a/ext/standard/tests/file/fgetcsv_variation19.phpt +++ b/ext/standard/tests/file/fgetcsv_variation19.phpt @@ -56,7 +56,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation2.phpt b/ext/standard/tests/file/fgetcsv_variation2.phpt index 7b875b821..d1e446d1f 100644 --- a/ext/standard/tests/file/fgetcsv_variation2.phpt +++ b/ext/standard/tests/file/fgetcsv_variation2.phpt @@ -59,7 +59,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation20.phpt b/ext/standard/tests/file/fgetcsv_variation20.phpt index e96089e9a..70bd8acbb 100644 --- a/ext/standard/tests/file/fgetcsv_variation20.phpt +++ b/ext/standard/tests/file/fgetcsv_variation20.phpt @@ -38,7 +38,7 @@ $loop_counter = 1; fwrite($file_handle, "This is line of text without csv fields\n"); // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation21.phpt b/ext/standard/tests/file/fgetcsv_variation21.phpt index e6a9ee586..ae8c4f1ef 100644 --- a/ext/standard/tests/file/fgetcsv_variation21.phpt +++ b/ext/standard/tests/file/fgetcsv_variation21.phpt @@ -38,7 +38,7 @@ $loop_counter = 1; fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation24.phpt b/ext/standard/tests/file/fgetcsv_variation24.phpt index 89b6d03b9..cdfadceb7 100644 --- a/ext/standard/tests/file/fgetcsv_variation24.phpt +++ b/ext/standard/tests/file/fgetcsv_variation24.phpt @@ -59,7 +59,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation25.phpt b/ext/standard/tests/file/fgetcsv_variation25.phpt index 1877bc0a0..52e830cb5 100644 --- a/ext/standard/tests/file/fgetcsv_variation25.phpt +++ b/ext/standard/tests/file/fgetcsv_variation25.phpt @@ -62,7 +62,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation27.phpt b/ext/standard/tests/file/fgetcsv_variation27.phpt index aafc3ab6c..a215e90a3 100644 --- a/ext/standard/tests/file/fgetcsv_variation27.phpt +++ b/ext/standard/tests/file/fgetcsv_variation27.phpt @@ -62,7 +62,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation28.phpt b/ext/standard/tests/file/fgetcsv_variation28.phpt index 56dd538ac..4e6fed317 100644 --- a/ext/standard/tests/file/fgetcsv_variation28.phpt +++ b/ext/standard/tests/file/fgetcsv_variation28.phpt @@ -62,7 +62,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation29.phpt b/ext/standard/tests/file/fgetcsv_variation29.phpt index 08c750351..042086032 100644 --- a/ext/standard/tests/file/fgetcsv_variation29.phpt +++ b/ext/standard/tests/file/fgetcsv_variation29.phpt @@ -57,7 +57,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation3.phpt b/ext/standard/tests/file/fgetcsv_variation3.phpt index 52c094faa..8cde39da2 100644 --- a/ext/standard/tests/file/fgetcsv_variation3.phpt +++ b/ext/standard/tests/file/fgetcsv_variation3.phpt @@ -59,7 +59,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation31.phpt b/ext/standard/tests/file/fgetcsv_variation31.phpt index 1d896b791..7d1e90e1f 100644 --- a/ext/standard/tests/file/fgetcsv_variation31.phpt +++ b/ext/standard/tests/file/fgetcsv_variation31.phpt @@ -57,7 +57,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation4.phpt b/ext/standard/tests/file/fgetcsv_variation4.phpt index 0c8448472..da945daa7 100644 --- a/ext/standard/tests/file/fgetcsv_variation4.phpt +++ b/ext/standard/tests/file/fgetcsv_variation4.phpt @@ -58,7 +58,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation5.phpt b/ext/standard/tests/file/fgetcsv_variation5.phpt index 283fa40bd..d3564e401 100644 --- a/ext/standard/tests/file/fgetcsv_variation5.phpt +++ b/ext/standard/tests/file/fgetcsv_variation5.phpt @@ -61,7 +61,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation6.phpt b/ext/standard/tests/file/fgetcsv_variation6.phpt index 9878cb98d..844dd7c51 100644 --- a/ext/standard/tests/file/fgetcsv_variation6.phpt +++ b/ext/standard/tests/file/fgetcsv_variation6.phpt @@ -61,7 +61,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation7.phpt b/ext/standard/tests/file/fgetcsv_variation7.phpt index 723328e08..271a55b00 100644 --- a/ext/standard/tests/file/fgetcsv_variation7.phpt +++ b/ext/standard/tests/file/fgetcsv_variation7.phpt @@ -58,7 +58,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation8.phpt b/ext/standard/tests/file/fgetcsv_variation8.phpt index 21b6c8875..bf06d29b4 100644 --- a/ext/standard/tests/file/fgetcsv_variation8.phpt +++ b/ext/standard/tests/file/fgetcsv_variation8.phpt @@ -62,7 +62,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgetcsv_variation9.phpt b/ext/standard/tests/file/fgetcsv_variation9.phpt index 6400fc84e..294241e6c 100644 --- a/ext/standard/tests/file/fgetcsv_variation9.phpt +++ b/ext/standard/tests/file/fgetcsv_variation9.phpt @@ -61,7 +61,7 @@ foreach ($csv_lists as $csv_list) { fwrite($file_handle, "\n"); // blank line // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to begining of the file + // else rewind the file pointer to beginning of the file if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); diff --git a/ext/standard/tests/file/fgets_variation1.phpt b/ext/standard/tests/file/fgets_variation1.phpt index 48ea23119..68a20e899 100644 --- a/ext/standard/tests/file/fgets_variation1.phpt +++ b/ext/standard/tests/file/fgets_variation1.phpt @@ -29,7 +29,7 @@ foreach ($file_modes as $file_mode ) { $data = "fgets_variation test"; fwrite($file_handle, $data); - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); diff --git a/ext/standard/tests/file/fgets_variation3.phpt b/ext/standard/tests/file/fgets_variation3.phpt index 4f0364132..b39ba0c6a 100644 --- a/ext/standard/tests/file/fgets_variation3.phpt +++ b/ext/standard/tests/file/fgets_variation3.phpt @@ -36,7 +36,7 @@ foreach($file_modes as $file_mode) { } echo "-- fgets() with default length, file pointer at 0 --\n"; - // get the file pointer to begining of the file + // get the file pointer to beginning of the file rewind($file_handle); var_dump( ftell($file_handle) ); @@ -45,7 +45,7 @@ foreach($file_modes as $file_mode) { var_dump( feof($file_handle) ); // enusre if eof set echo "-- fgets() with length = 23, Expected: 22 chars, file pointer at 0 --\n"; - // get the file pointer to begining of the file + // get the file pointer to beginning of the file rewind($file_handle); var_dump( ftell($file_handle) ); diff --git a/ext/standard/tests/file/fgetss_basic2-win32.phpt b/ext/standard/tests/file/fgetss_basic2-win32.phpt index 9187fe532..ca6f40cb9 100644 --- a/ext/standard/tests/file/fgetss_basic2-win32.phpt +++ b/ext/standard/tests/file/fgetss_basic2-win32.phpt @@ -48,7 +48,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { exit(); } - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( filesize($filename) ); var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); diff --git a/ext/standard/tests/file/fgetss_basic2.phpt b/ext/standard/tests/file/fgetss_basic2.phpt index 63fdde850..86be24810 100644 --- a/ext/standard/tests/file/fgetss_basic2.phpt +++ b/ext/standard/tests/file/fgetss_basic2.phpt @@ -46,7 +46,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { exit(); } - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( filesize($filename) ); var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); diff --git a/ext/standard/tests/file/fgetss_variation1-win32.phpt b/ext/standard/tests/file/fgetss_variation1-win32.phpt index 0aca5d376..7cd49333b 100644 --- a/ext/standard/tests/file/fgetss_variation1-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation1-win32.phpt @@ -56,7 +56,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { exit(); } - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( filesize($filename) ); var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); diff --git a/ext/standard/tests/file/fgetss_variation1.phpt b/ext/standard/tests/file/fgetss_variation1.phpt index d85b09556..5a0556a19 100644 --- a/ext/standard/tests/file/fgetss_variation1.phpt +++ b/ext/standard/tests/file/fgetss_variation1.phpt @@ -52,7 +52,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { exit(); } - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( filesize($filename) ); var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); diff --git a/ext/standard/tests/file/fgetss_variation2.phpt b/ext/standard/tests/file/fgetss_variation2.phpt index d155f0868..a436e8c4b 100644 --- a/ext/standard/tests/file/fgetss_variation2.phpt +++ b/ext/standard/tests/file/fgetss_variation2.phpt @@ -44,7 +44,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { exit(); } - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( filesize($filename) ); var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); diff --git a/ext/standard/tests/file/fgetss_variation3-win32.phpt b/ext/standard/tests/file/fgetss_variation3-win32.phpt index 7539b3687..fc7561dff 100644 --- a/ext/standard/tests/file/fgetss_variation3-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation3-win32.phpt @@ -55,7 +55,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { exit(); } - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file rewind($file_handle); var_dump( ftell($file_handle) ); var_dump( filesize($filename) ); diff --git a/ext/standard/tests/file/fgetss_variation3.phpt b/ext/standard/tests/file/fgetss_variation3.phpt index 5b339a1bb..e6f63c310 100644 --- a/ext/standard/tests/file/fgetss_variation3.phpt +++ b/ext/standard/tests/file/fgetss_variation3.phpt @@ -51,7 +51,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { exit(); } - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file rewind($file_handle); var_dump( ftell($file_handle) ); var_dump( filesize($filename) ); diff --git a/ext/standard/tests/file/fgetss_variation4.phpt b/ext/standard/tests/file/fgetss_variation4.phpt index 6c201d1a9..b93bc6afd 100644 --- a/ext/standard/tests/file/fgetss_variation4.phpt +++ b/ext/standard/tests/file/fgetss_variation4.phpt @@ -47,7 +47,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { exit(); } - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( filesize($filename) ); var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); diff --git a/ext/standard/tests/file/fgetss_variation5-win32.phpt b/ext/standard/tests/file/fgetss_variation5-win32.phpt index cedc7b98d..a2d4a705e 100644 --- a/ext/standard/tests/file/fgetss_variation5-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation5-win32.phpt @@ -52,7 +52,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { echo "Error: failed to open file $filename!\n"; exit(); } - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( filesize($filename) ); var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); diff --git a/ext/standard/tests/file/fgetss_variation5.phpt b/ext/standard/tests/file/fgetss_variation5.phpt index ea53382e2..c499d598b 100644 --- a/ext/standard/tests/file/fgetss_variation5.phpt +++ b/ext/standard/tests/file/fgetss_variation5.phpt @@ -49,7 +49,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { echo "Error: failed to open file $filename!\n"; exit(); } - // rewind the file pointer to begining of the file + // rewind the file pointer to beginning of the file var_dump( filesize($filename) ); var_dump( rewind($file_handle) ); var_dump( ftell($file_handle) ); diff --git a/ext/standard/tests/file/file.inc b/ext/standard/tests/file/file.inc index c0f86e7c3..b3cd99e1c 100644 --- a/ext/standard/tests/file/file.inc +++ b/ext/standard/tests/file/file.inc @@ -575,13 +575,13 @@ Description: Compares two stat values, stat value should be obtained by stat/lstat $stat1 = first stat array $stat2 = second stat array - $op = type of the comparision to be perform between elements of stat1 and stat2 + $op = type of the comparison to be perform between elements of stat1 and stat2 "!=" compare for not equal "==" compare for equality ">" if each element of stat1 is > than stat2 "<" if each element of stat1 is < than stat2 $fields = contains the key of the elements that needs to be compared. - type of the comparision is based on $op argument value + type of the comparison is based on $op argument value $flag = specify true to dump the stat1 and stat2 */ diff --git a/ext/standard/tests/file/file_get_contents_error001.phpt b/ext/standard/tests/file/file_get_contents_error001.phpt index 127901ad7..a347d9d3d 100644 --- a/ext/standard/tests/file/file_get_contents_error001.phpt +++ b/ext/standard/tests/file/file_get_contents_error001.phpt @@ -10,6 +10,7 @@ display_errors=false if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (!function_exists("file_get_contents")) die ("skip file_get_contents function is not found"); + if (getenv("SKIP_ONLINE_TESTS")) die("skip online test"); ?> --FILE-- <?php diff --git a/ext/standard/tests/file/fileinode_error.phpt b/ext/standard/tests/file/fileinode_error.phpt index d716c4ae5..eb5d79e0c 100644 --- a/ext/standard/tests/file/fileinode_error.phpt +++ b/ext/standard/tests/file/fileinode_error.phpt @@ -16,10 +16,10 @@ var_dump( fileinode("/no/such/file/dir") ); var_dump( fileinode("string") ); var_dump( fileinode(100) ); -/* No.of argumetns less than expected */ +/* No.of arguments less than expected */ var_dump( fileinode() ); -/* No.of argumetns greater than expected */ +/* No.of arguments greater than expected */ var_dump( fileinode(__FILE__, "string") ); echo "\n*** Done ***"; diff --git a/ext/standard/tests/file/fpassthru_variation.phpt b/ext/standard/tests/file/fpassthru_variation.phpt index 56a039e62..749eefb4c 100644 --- a/ext/standard/tests/file/fpassthru_variation.phpt +++ b/ext/standard/tests/file/fpassthru_variation.phpt @@ -12,7 +12,7 @@ echo "*** Testing fpassthru() function with files ***\n\n"; echo "--- Testing with different offsets ---\n"; -$file_name = dirname(__FILE__)."/passthru.tmp"; +$file_name = dirname(__FILE__)."/passthru_variation.tmp"; $file_write = fopen($file_name, "w"); fwrite($file_write, "1234567890abcdefghijklmnopqrstuvwxyz"); fclose($file_write); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt index 18ecf9a1d..915ab0e55 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt @@ -52,7 +52,7 @@ foreach($file_content_types as $file_content_type){ fwrite($file_handle,(binary)$data_to_be_written); // set file pointer to 0 - var_dump( rewind($file_handle) ); // set to begining of file + var_dump( rewind($file_handle) ); // set to beginning of file var_dump( ftell($file_handle) ); foreach($whence_set as $whence){ diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt index 866009467..63d0edd5a 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt @@ -51,7 +51,7 @@ foreach($file_content_types as $file_content_type){ fwrite($file_handle,(binary)$data_to_be_written); // set file pointer to 0 - var_dump( rewind($file_handle) ); // set to begining of file + var_dump( rewind($file_handle) ); // set to beginning of file var_dump( ftell($file_handle) ); foreach($whence_set as $whence){ diff --git a/ext/standard/tests/file/fstat_variation1.phpt b/ext/standard/tests/file/fstat_variation1.phpt index b2ad54196..14b7b31c4 100644 --- a/ext/standard/tests/file/fstat_variation1.phpt +++ b/ext/standard/tests/file/fstat_variation1.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function fstat() by substituting agument 1 with array values. +Test function fstat() by substituting argument 1 with array values. --FILE-- <?php $index_array = array(1, 2, 3); diff --git a/ext/standard/tests/file/fstat_variation2.phpt b/ext/standard/tests/file/fstat_variation2.phpt index fd62f23b6..6368c3b84 100644 --- a/ext/standard/tests/file/fstat_variation2.phpt +++ b/ext/standard/tests/file/fstat_variation2.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function fstat() by substituting agument 1 with boolean values. +Test function fstat() by substituting argument 1 with boolean values. --FILE-- <?php $variation_array = array( diff --git a/ext/standard/tests/file/fstat_variation3.phpt b/ext/standard/tests/file/fstat_variation3.phpt index 4cd74e3c1..59de1bbfc 100644 --- a/ext/standard/tests/file/fstat_variation3.phpt +++ b/ext/standard/tests/file/fstat_variation3.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function fstat() by substituting agument 1 with emptyUnsetUndefNull values. +Test function fstat() by substituting argument 1 with emptyUnsetUndefNull values. --FILE-- <?php $unset_var = 10; diff --git a/ext/standard/tests/file/fstat_variation4.phpt b/ext/standard/tests/file/fstat_variation4.phpt index 16497760b..dc2575f7d 100644 --- a/ext/standard/tests/file/fstat_variation4.phpt +++ b/ext/standard/tests/file/fstat_variation4.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function fstat() by substituting agument 1 with float values. +Test function fstat() by substituting argument 1 with float values. --FILE-- <?php $variation_array = array( diff --git a/ext/standard/tests/file/fstat_variation5.phpt b/ext/standard/tests/file/fstat_variation5.phpt index ef4f4eaf3..6f98da81e 100644 --- a/ext/standard/tests/file/fstat_variation5.phpt +++ b/ext/standard/tests/file/fstat_variation5.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function fstat() by substituting agument 1 with int values. +Test function fstat() by substituting argument 1 with int values. --FILE-- <?php $variation_array = array ( diff --git a/ext/standard/tests/file/fstat_variation6.phpt b/ext/standard/tests/file/fstat_variation6.phpt index 0789ff7a9..01f6d3619 100644 --- a/ext/standard/tests/file/fstat_variation6.phpt +++ b/ext/standard/tests/file/fstat_variation6.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function fstat() by substituting agument 1 with object values. +Test function fstat() by substituting argument 1 with object values. --FILE-- <?php diff --git a/ext/standard/tests/file/fstat_variation7.phpt b/ext/standard/tests/file/fstat_variation7.phpt index 1f3f001b2..5a55dceb9 100644 --- a/ext/standard/tests/file/fstat_variation7.phpt +++ b/ext/standard/tests/file/fstat_variation7.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function fstat() by substituting agument 1 with string values. +Test function fstat() by substituting argument 1 with string values. --FILE-- <?php $heredoc = <<<EOT diff --git a/ext/standard/tests/file/glob_variation3.phpt b/ext/standard/tests/file/glob_variation3.phpt new file mode 100644 index 000000000..9e1e28baf --- /dev/null +++ b/ext/standard/tests/file/glob_variation3.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test glob() function: ensure no platform difference +--FILE-- +<?php +$path = dirname(__FILE__); + +ini_set('open_basedir', NULL); +var_dump(glob("$path/*.none")); + +ini_set('open_basedir', $path); +var_dump(glob("$path/*.none")); + +?> +==DONE== +--EXPECT-- +array(0) { +} +bool(false) +==DONE== diff --git a/ext/standard/tests/file/lchown_basic.phpt b/ext/standard/tests/file/lchown_basic.phpt index 9675d3aca..f2aff597c 100644 --- a/ext/standard/tests/file/lchown_basic.phpt +++ b/ext/standard/tests/file/lchown_basic.phpt @@ -14,8 +14,8 @@ if (!function_exists("posix_getuid")) die("skip no posix_getuid()"); */ echo "*** Testing lchown() : basic functionality ***\n"; -$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt'; -$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt'; +$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic.txt'; +$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt'; $uid = posix_getuid(); @@ -29,8 +29,8 @@ var_dump( fileowner( $symlink ) === $uid ); --CLEAN-- <?php -$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt'; -$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt'; +$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic.txt'; +$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt'; unlink($filename); unlink($symlink); diff --git a/ext/standard/tests/file/lchown_error.phpt b/ext/standard/tests/file/lchown_error.phpt index 979959e28..bacbd93c8 100644 --- a/ext/standard/tests/file/lchown_error.phpt +++ b/ext/standard/tests/file/lchown_error.phpt @@ -36,7 +36,7 @@ var_dump( lchown( $filename ) ); // More than expected arguments var_dump( lchown( $filename, $uid, 'foobar' ) ); -// Non-existant filename +// Non-existent filename var_dump( lchown( 'foobar_lchown.txt', $uid ) ); // Wrong argument types diff --git a/ext/standard/tests/file/mkdir-001.phpt b/ext/standard/tests/file/mkdir-001.phpt index be653da29..d1a7cebfa 100644 --- a/ext/standard/tests/file/mkdir-001.phpt +++ b/ext/standard/tests/file/mkdir-001.phpt @@ -3,20 +3,20 @@ mkdir() tests --FILE-- <?php -var_dump(mkdir("testdir")); -var_dump(mkdir("testdir/subdir")); -var_dump(rmdir("testdir/subdir")); -var_dump(rmdir("testdir")); +var_dump(mkdir("mkdir-001")); +var_dump(mkdir("mkdir-001/subdir")); +var_dump(rmdir("mkdir-001/subdir")); +var_dump(rmdir("mkdir-001")); -var_dump(mkdir("./testdir")); -var_dump(mkdir("./testdir/subdir")); -var_dump(rmdir("./testdir/subdir")); -var_dump(rmdir("./testdir")); +var_dump(mkdir("./mkdir-001")); +var_dump(mkdir("./mkdir-001/subdir")); +var_dump(rmdir("./mkdir-001/subdir")); +var_dump(rmdir("./mkdir-001")); -var_dump(mkdir(dirname(__FILE__)."/testdir")); -var_dump(mkdir(dirname(__FILE__)."/testdir/subdir")); -var_dump(rmdir(dirname(__FILE__)."/testdir/subdir")); -var_dump(rmdir(dirname(__FILE__)."/testdir")); +var_dump(mkdir(dirname(__FILE__)."/mkdir-001")); +var_dump(mkdir(dirname(__FILE__)."/mkdir-001/subdir")); +var_dump(rmdir(dirname(__FILE__)."/mkdir-001/subdir")); +var_dump(rmdir(dirname(__FILE__)."/mkdir-001")); echo "Done\n"; ?> diff --git a/ext/standard/tests/file/mkdir-002.phpt b/ext/standard/tests/file/mkdir-002.phpt index ccfd6c3d7..d149098df 100644 --- a/ext/standard/tests/file/mkdir-002.phpt +++ b/ext/standard/tests/file/mkdir-002.phpt @@ -9,24 +9,24 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { --FILE-- <?php -var_dump(mkdir("testdir", 0777)); -var_dump(mkdir("testdir/subdir", 0777)); -var_dump(`ls -l testdir`); -var_dump(rmdir("testdir/subdir")); -var_dump(rmdir("testdir")); +var_dump(mkdir("mkdir-002", 0777)); +var_dump(mkdir("mkdir-002/subdir", 0777)); +var_dump(`ls -l mkdir-002`); +var_dump(rmdir("mkdir-002/subdir")); +var_dump(rmdir("mkdir-002")); -var_dump(mkdir("./testdir", 0777)); -var_dump(mkdir("./testdir/subdir", 0777)); -var_dump(`ls -l ./testdir`); -var_dump(rmdir("./testdir/subdir")); -var_dump(rmdir("./testdir")); +var_dump(mkdir("./mkdir-002", 0777)); +var_dump(mkdir("./mkdir-002/subdir", 0777)); +var_dump(`ls -l ./mkdir-002`); +var_dump(rmdir("./mkdir-002/subdir")); +var_dump(rmdir("./mkdir-002")); -var_dump(mkdir(dirname(__FILE__)."/testdir", 0777)); -var_dump(mkdir(dirname(__FILE__)."/testdir/subdir", 0777)); -$dirname = dirname(__FILE__)."/testdir"; +var_dump(mkdir(dirname(__FILE__)."/mkdir-002", 0777)); +var_dump(mkdir(dirname(__FILE__)."/mkdir-002/subdir", 0777)); +$dirname = dirname(__FILE__)."/mkdir-002"; var_dump(`ls -l $dirname`); -var_dump(rmdir(dirname(__FILE__)."/testdir/subdir")); -var_dump(rmdir(dirname(__FILE__)."/testdir")); +var_dump(rmdir(dirname(__FILE__)."/mkdir-002/subdir")); +var_dump(rmdir(dirname(__FILE__)."/mkdir-002")); echo "Done\n"; ?> diff --git a/ext/standard/tests/file/mkdir-003.phpt b/ext/standard/tests/file/mkdir-003.phpt index 50ad5e6c4..fdd49f340 100644 --- a/ext/standard/tests/file/mkdir-003.phpt +++ b/ext/standard/tests/file/mkdir-003.phpt @@ -3,17 +3,17 @@ recursive mkdir() tests --FILE-- <?php -var_dump(mkdir("testdir/subdir", 0777, true)); -var_dump(rmdir("testdir/subdir")); -var_dump(rmdir("testdir")); +var_dump(mkdir("mkdir-003/subdir", 0777, true)); +var_dump(rmdir("mkdir-003/subdir")); +var_dump(rmdir("mkdir-003")); -var_dump(mkdir("./testdir/subdir", 0777, true)); -var_dump(rmdir("./testdir/subdir")); -var_dump(rmdir("./testdir")); +var_dump(mkdir("./mkdir-003/subdir", 0777, true)); +var_dump(rmdir("./mkdir-003/subdir")); +var_dump(rmdir("./mkdir-003")); -var_dump(mkdir(dirname(__FILE__)."/testdir/subdir", 0777, true)); -var_dump(rmdir(dirname(__FILE__)."/testdir/subdir")); -var_dump(rmdir(dirname(__FILE__)."/testdir")); +var_dump(mkdir(dirname(__FILE__)."/mkdir-003/subdir", 0777, true)); +var_dump(rmdir(dirname(__FILE__)."/mkdir-003/subdir")); +var_dump(rmdir(dirname(__FILE__)."/mkdir-003")); echo "Done\n"; ?> diff --git a/ext/standard/tests/file/symlink_to_symlink.phpt b/ext/standard/tests/file/symlink_to_symlink.phpt index b7554f9bd..8b7ff65cf 100644 --- a/ext/standard/tests/file/symlink_to_symlink.phpt +++ b/ext/standard/tests/file/symlink_to_symlink.phpt @@ -19,8 +19,8 @@ symlink(basename($prefix . "_file"), $prefix . "_link1"); symlink(basename($prefix . "_link1"), $prefix . "_link2"); // symlink to a non-existent path -@unlink($prefix . "_nonexistant"); -symlink(basename($prefix . "_nonexistant"), $prefix . "_link3"); +@unlink($prefix . "_nonexistent"); +symlink(basename($prefix . "_nonexistent"), $prefix . "_link3"); // symlink to a regular file using an absolute path symlink($prefix . "_file", $prefix . "_link4"); @@ -45,6 +45,6 @@ unlink($prefix . "_file"); --EXPECTF-- %unicode|string%(%d) "symlink_to_symlink.php_file" %unicode|string%(%d) "symlink_to_symlink.php_link1" -%unicode|string%(%d) "symlink_to_symlink.php_nonexistant" +%unicode|string%(%d) "symlink_to_symlink.php_nonexistent" %unicode|string%(%d) "%s/symlink_to_symlink.php_file" %unicode|string%(%d) "%s/symlink_to_symlink.php_link4" diff --git a/ext/standard/tests/file/tempnam_variation5.phpt b/ext/standard/tests/file/tempnam_variation5.phpt index 26c3f91f1..cf2eff8be 100644 --- a/ext/standard/tests/file/tempnam_variation5.phpt +++ b/ext/standard/tests/file/tempnam_variation5.phpt @@ -16,13 +16,13 @@ if(substr(PHP_OS, 0, 3) == "WIN") $file_path = dirname(__FILE__); echo "*** Test tempnam() function: by passing an existing filename as prefix ***\n"; -$dir_name = $file_path."/tempnam_variation6"; +$dir_name = $file_path."/tempnam_variation5"; mkdir($dir_name); -$h = fopen($dir_name."/tempnam_variation6.tmp", "w"); +$h = fopen($dir_name."/tempnam_variation5.tmp", "w"); for($i=1; $i<=3; $i++) { echo "-- Iteration $i --\n"; - $created_file = tempnam("$dir_name", "tempnam_variation6.tmp"); + $created_file = tempnam("$dir_name", "tempnam_variation5.tmp"); if( file_exists($created_file) ) { echo "File name is => "; @@ -35,7 +35,7 @@ for($i=1; $i<=3; $i++) { unlink($created_file); } fclose($h); -unlink($dir_name."/tempnam_variation6.tmp"); +unlink($dir_name."/tempnam_variation5.tmp"); rmdir($dir_name); echo "\n*** Done ***\n"; @@ -43,10 +43,10 @@ echo "\n*** Done ***\n"; --EXPECTF-- *** Test tempnam() function: by passing an existing filename as prefix *** -- Iteration 1 -- -File name is => %stempnam_variation6%etempnam_variation6.tmp%s +File name is => %stempnam_variation5%etempnam_variation5.tmp%s -- Iteration 2 -- -File name is => %stempnam_variation6%etempnam_variation6.tmp%s +File name is => %stempnam_variation5%etempnam_variation5.tmp%s -- Iteration 3 -- -File name is => %stempnam_variation6%etempnam_variation6.tmp%s +File name is => %stempnam_variation5%etempnam_variation5.tmp%s *** Done *** diff --git a/ext/standard/tests/file/touch_basic.phpt b/ext/standard/tests/file/touch_basic.phpt index c41fdf1d7..b39c84b7e 100644 --- a/ext/standard/tests/file/touch_basic.phpt +++ b/ext/standard/tests/file/touch_basic.phpt @@ -19,7 +19,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { echo "*** Testing touch() : basic functionality ***\n"; -$filename = dirname(__FILE__)."/touch.dat"; +$filename = dirname(__FILE__)."/touch_basic.dat"; echo "\n--- testing touch creates a file ---\n"; @unlink($filename); diff --git a/ext/standard/tests/file/touch_variation2.phpt b/ext/standard/tests/file/touch_variation2.phpt index 9ccb90c75..9477a3494 100644 --- a/ext/standard/tests/file/touch_variation2.phpt +++ b/ext/standard/tests/file/touch_variation2.phpt @@ -6,7 +6,7 @@ Dave Kelsey <d_kelsey@uk.ibm.com> <?php -$filename = dirname(__FILE__)."/touch.dat"; +$filename = dirname(__FILE__)."/touch_variation2.dat"; $fp=fopen($filename,"w"); fwrite ($fp,"mydata"); fclose($fp); diff --git a/ext/standard/tests/file/userstreams.phpt b/ext/standard/tests/file/userstreams.phpt index b5a9707e9..d39898bbe 100644 --- a/ext/standard/tests/file/userstreams.phpt +++ b/ext/standard/tests/file/userstreams.phpt @@ -158,7 +158,7 @@ class mystream } if (@stream_wrapper_register("bogus", "class_not_exist")) { - die("Registered a non-existant class!!!???"); + die("Registered a non-existent class!!!???"); } echo "Not Registered\n"; diff --git a/ext/standard/tests/general_functions/dl-cve-2007-4887.phpt b/ext/standard/tests/general_functions/dl-cve-2007-4887.phpt index e242d45dc..c53b5153f 100644 --- a/ext/standard/tests/general_functions/dl-cve-2007-4887.phpt +++ b/ext/standard/tests/general_functions/dl-cve-2007-4887.phpt @@ -1,5 +1,12 @@ --TEST-- dl() filename length checks (CVE-2007-4887) +--SKIPIF-- +<?php +$enabled_sapi = array('cgi-fcgi', 'cli', 'embed', 'fpm'); +if (!in_array(php_sapi_name(), $enabled_sapi)) { + die('skip dl() is not enabled for ' . php_sapi_name()); +} +?> --INI-- enable_dl=1 --FILE-- diff --git a/ext/standard/tests/http/bug61548.phpt b/ext/standard/tests/http/bug61548.phpt new file mode 100644 index 000000000..138b15a33 --- /dev/null +++ b/ext/standard/tests/http/bug61548.phpt @@ -0,0 +1,118 @@ +--TEST-- +Bug #61548 (content-type must appear at the end of headers) +--INI-- +allow_url_fopen=1 +--SKIPIF-- +<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?> +--FILE-- +<?php +require 'server.inc'; + +function do_test($header) { + $options = [ + 'http' => [ + 'method' => 'POST', + 'header' => $header, + 'follow_location' => true, + ], + ]; + + $ctx = stream_context_create($options); + + $responses = [ + "data://text/plain,HTTP/1.1 201\r\nLocation: /foo\r\n\r\n", + "data://text/plain,HTTP/1.1 200\r\nConnection: close\r\n\r\n", + ]; + $pid = http_server('tcp://127.0.0.1:12342', $responses, $output); + + $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $ctx); + fseek($output, 0, SEEK_SET); + echo stream_get_contents($output); + + http_server_kill($pid); +} + +do_test("First:1\nSecond:2\nContent-type: text/plain"); +do_test("First:1\nSecond:2\nContent-type: text/plain\n"); +do_test("First:1\nSecond:2\nContent-type: text/plain\nThird:"); +do_test("First:1\nContent-type:text/plain\nSecond:2"); +do_test("First:1\nContent-type:text/plain\nSecond:2\n"); +do_test("First:1\nContent-type:text/plain\nSecond:2\nThird:"); + +?> +Done +--EXPECT-- +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 +Content-type: text/plain + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 + + +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 +Content-type: text/plain + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 + + +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 +Content-type: text/plain +Third: + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 +Third: + +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Content-type:text/plain +Second:2 + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 + +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Content-type:text/plain +Second:2 + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 + +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Content-type:text/plain +Second:2 +Third: + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 +Third: + +Done + diff --git a/ext/standard/tests/mail/ezmlm_hash_variation1.phpt b/ext/standard/tests/mail/ezmlm_hash_variation1.phpt index aa1e521e9..58957c84a 100644 --- a/ext/standard/tests/mail/ezmlm_hash_variation1.phpt +++ b/ext/standard/tests/mail/ezmlm_hash_variation1.phpt @@ -24,8 +24,8 @@ class sample { //getting the resource $file_handle = fopen(__FILE__, "r"); -// array with different values for $delimeter -$delimeters = array ( +// array with different values for $delimiter +$delimiters = array ( // integer values 0, @@ -68,13 +68,13 @@ $delimeters = array ( @$unset_var ); -// loop through with each element of the $delimeters array to test explode() function +// loop through with each element of the $delimiters array to test explode() function $count = 1; $string = "piece1 piece2 piece3 piece4 piece5 piece6"; $limit = 5; -foreach($delimeters as $delimeter) { +foreach($delimiters as $delimiter) { echo "-- Iteration $count --\n"; - var_dump( explode($delimeter, $string, $limit) ); + var_dump( explode($delimiter, $string, $limit) ); $count ++; } diff --git a/ext/standard/tests/mail/mail_include.inc b/ext/standard/tests/mail/mail_include.inc index a0ff5e0c1..0785552e5 100644 --- a/ext/standard/tests/mail/mail_include.inc +++ b/ext/standard/tests/mail/mail_include.inc @@ -15,7 +15,7 @@ $mailbox_prefix = "phpttest"; // name used for test mailbox * @para, string mailbox_suffix Suffix used to uniquely identify mailboxes * @param int message_count number of test msgs to be written to new mailbox * - * @return IMAP stream to new mailbox on sucesss; FALSE on failure + * @return IMAP stream to new mailbox on success; FALSE on failure */ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){ global $server, $default_mailbox, $username, $password; diff --git a/ext/standard/tests/serialize/bug65481.phpt b/ext/standard/tests/serialize/bug65481.phpt new file mode 100644 index 000000000..65634f63b --- /dev/null +++ b/ext/standard/tests/serialize/bug65481.phpt @@ -0,0 +1,40 @@ +--TEST-- +Bug #65481 (shutdown segfault due to serialize) +--FILE-- +<?php +echo "Test\n"; + +class A { + public $e = array(); +} + +class Token implements \Serializable { + public function serialize() + { + $c = new A; + + for ($i = 0; $i < 4; $i++) + { + $e = new A; + $c->e[] = $e; + $e->e = $c->e; + } + + return serialize(array(serialize($c))); + } + + public function unserialize($str) + { + $r = unserialize($str); + $r = unserialize($r[0]); + } +} + +$token = new Token; +$token = serialize($token); + +?> +Done +--EXPECT-- +Test +Done diff --git a/ext/standard/tests/streams/bug64166.phpt b/ext/standard/tests/streams/bug64166.phpt new file mode 100644 index 000000000..e725a4b69 --- /dev/null +++ b/ext/standard/tests/streams/bug64166.phpt @@ -0,0 +1,46 @@ +--TEST-- +Bug #64166: quoted-printable-encode stream filter incorrectly discarding whitespace +--FILE-- +<?php + +function test_64166($data) { + $fd = fopen('php://temp', 'w+'); + fwrite($fd, $data); + rewind($fd); + + $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array( + 'line-break-chars' => "\n", + 'line-length' => 74 + )); + var_dump(stream_get_contents($fd, -1, 0)); + + stream_filter_remove($res); + + rewind($fd); + stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array( + 'line-break-chars' => "\n", + 'line-length' => 6 + )); + var_dump(stream_get_contents($fd, -1, 0)); + + fclose($fd); +} + +test_64166("FIRST \nSECOND"); +test_64166("FIRST \nSECOND"); + +?> +--EXPECT-- +string(15) "FIRST=20 +SECOND" +string(19) "FIRST= +=20 +SECON= +D" +string(18) "FIRST=20=20 +SECOND" +string(24) "FIRST= +=20= +=20 +SECON= +D" diff --git a/ext/standard/tests/streams/bug64166_2.phpt b/ext/standard/tests/streams/bug64166_2.phpt new file mode 100644 index 000000000..9d6655d5c --- /dev/null +++ b/ext/standard/tests/streams/bug64166_2.phpt @@ -0,0 +1,50 @@ +--TEST-- +Bug #64166: quoted-printable-encode stream filter incorrectly discarding whitespace - split reads +--FILE-- +<?php + +function test_64166($data) { + $fd = fopen('php://temp', 'w+'); + fwrite($fd, $data); + rewind($fd); + + $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array( + 'line-break-chars' => "\n", + 'line-length' => 74 + )); + $str = ""; + while(($c = fread($fd, 1))!= "") $str .= $c; + var_dump($str); + + stream_filter_remove($res); + + rewind($fd); + stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array( + 'line-break-chars' => "\n", + 'line-length' => 6 + )); + $str = ""; + while(($c = fread($fd, 1))!= "") $str .= $c; + var_dump($str); + + fclose($fd); +} + +test_64166("FIRST \nSECOND"); +test_64166("FIRST \nSECOND"); + +?> +--EXPECT-- +string(15) "FIRST=20 +SECOND" +string(19) "FIRST= +=20 +SECON= +D" +string(18) "FIRST=20=20 +SECOND" +string(24) "FIRST= +=20= +=20 +SECON= +D" diff --git a/ext/standard/tests/streams/bug64166_3.phpt b/ext/standard/tests/streams/bug64166_3.phpt new file mode 100644 index 000000000..d896ba800 --- /dev/null +++ b/ext/standard/tests/streams/bug64166_3.phpt @@ -0,0 +1,48 @@ +--TEST-- +Bug #64166: quoted-printable-encode stream filter incorrectly discarding whitespace - writes +--FILE-- +<?php + +function test_64166($data) { + $fd = fopen('php://temp', 'w+'); + $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_WRITE, array( + 'line-break-chars' => "\n", + 'line-length' => 74 + )); + fwrite($fd, $data); + rewind($fd); + + var_dump(stream_get_contents($fd, -1, 0)); + + stream_filter_remove($res); + + rewind($fd); + stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_WRITE, array( + 'line-break-chars' => "\n", + 'line-length' => 6 + )); + fwrite($fd, $data); + rewind($fd); + var_dump(stream_get_contents($fd, -1, 0)); + + fclose($fd); +} + +test_64166("FIRST \nSECOND"); +test_64166("FIRST \nSECOND"); + +?> +--EXPECT-- +string(15) "FIRST=20 +SECOND" +string(19) "FIRST= +=20 +SECON= +D" +string(18) "FIRST=20=20 +SECOND" +string(24) "FIRST= +=20= +=20 +SECON= +D" diff --git a/ext/standard/tests/streams/bug64770.phpt b/ext/standard/tests/streams/bug64770.phpt new file mode 100644 index 000000000..785c4237a --- /dev/null +++ b/ext/standard/tests/streams/bug64770.phpt @@ -0,0 +1,52 @@ +--TEST-- +Bug #64770 stream_select() fails with pipes from proc_open() +--FILE-- +<?php + +$descs = array( + 0 => array('pipe', 'r'), // stdin + 1 => array('pipe', 'w'), // stdout + 2 => array('pipe', 'w'), // strerr +); + +$other_opts = array('suppress_errors' => false, 'binary_pipes' => true); + +$cmd = (substr(PHP_OS, 0, 3) == 'WIN') ? 'dir' : 'ls'; +$p = proc_open($cmd, $descs, $pipes, '.', NULL, $other_opts); + +if (is_resource($p)) { + $data = ''; + + while (1) { + $w = $e = NULL; + $n = stream_select($pipes, $w, $e, 300); + + if ($n === false) { + echo "no streams \n"; + break; + } else if ($n === 0) { + echo "process timed out\n"; + proc_terminate($p, 9); + break; + } else if ($n > 0) { + $line = fread($pipes[1], 8192); + if (strlen($line) == 0) { + /* EOF */ + break; + } + $data .= $line; + } + } + var_dump(strlen($data)); + + $ret = proc_close($p); + var_dump($ret); +} else { + echo "no process\n"; +} +?> +==DONE== +--EXPECTF-- +int(%d) +int(0) +==DONE== diff --git a/ext/standard/tests/streams/bug65483.phpt b/ext/standard/tests/streams/bug65483.phpt new file mode 100644 index 000000000..d214bbbbc --- /dev/null +++ b/ext/standard/tests/streams/bug65483.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #65483: quoted-printable encode stream filter incorrectly encoding spaces +--FILE-- +<?php + +$data = 'a b=c d'; + +$fd = fopen('php://temp', 'w+'); +fwrite($fd, $data); +rewind($fd); + +$res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ); +var_dump(stream_get_contents($fd, -1, 0)); + +fclose($fd); + +?> +--EXPECT-- +string(9) "a b=3Dc d" diff --git a/ext/standard/tests/strings/addslashes_variation1.phpt b/ext/standard/tests/strings/addslashes_variation1.phpt index cc245ae04..6dfeb7e69 100644 --- a/ext/standard/tests/strings/addslashes_variation1.phpt +++ b/ext/standard/tests/strings/addslashes_variation1.phpt @@ -79,7 +79,7 @@ $values = array ( // loop through each element of the array and check the working of addslashes() -// when $str arugment is supplied with different values +// when $str argument is supplied with different values echo "\n--- Testing addslashes() by supplying different values for 'str' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/bug36306.phpt b/ext/standard/tests/strings/bug36306.phpt index 2d8449aac..6317c974a 100644 --- a/ext/standard/tests/strings/bug36306.phpt +++ b/ext/standard/tests/strings/bug36306.phpt @@ -6,10 +6,10 @@ Bug #36306 (crc32() 64bit) /* as an example how to write crc32 tests PHP does not have uint values, you cannot display crc32 like a signed integer. - Have to find some small strings to truely reproduce + Have to find some small strings to truly reproduce the problem, this example being not a problem */ -echo dechex(crc32("platform independant")) . "\n"; +echo dechex(crc32("platform independent")) . "\n"; ?> --EXPECT-- -ccd9fe66 +cbd056ba diff --git a/ext/standard/tests/strings/bug38322.phpt b/ext/standard/tests/strings/bug38322.phpt index 37f5a93f6..79f66f1fa 100644 --- a/ext/standard/tests/strings/bug38322.phpt +++ b/ext/standard/tests/strings/bug38322.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #38322 (reading past array in sscanf() leads to segfault/arbitary code execution) +Bug #38322 (reading past array in sscanf() leads to segfault/arbitrary code execution) --FILE-- <?php diff --git a/ext/standard/tests/strings/bug47322.phpt b/ext/standard/tests/strings/bug47322.phpt index e04b230ba..1fedc2937 100644 --- a/ext/standard/tests/strings/bug47322.phpt +++ b/ext/standard/tests/strings/bug47322.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #47322 (sscanf %d does't work) +Bug #47322 (sscanf %d doesn't work) --FILE-- <?php diff --git a/ext/standard/tests/strings/bug50847.phpt b/ext/standard/tests/strings/bug50847.phpt index 28e83f511..1f7081930 100644 --- a/ext/standard/tests/strings/bug50847.phpt +++ b/ext/standard/tests/strings/bug50847.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #50847 (strip_tags() removes all tags greater then 1023 bytes long) +Bug #50847 (strip_tags() removes all tags greater than 1023 bytes long) --FILE-- <?php $var = '<param value="' . str_repeat("a", 2048) . '" />'; diff --git a/ext/standard/tests/strings/bug64879.phpt b/ext/standard/tests/strings/bug64879.phpt new file mode 100644 index 000000000..1df90c6d8 --- /dev/null +++ b/ext/standard/tests/strings/bug64879.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #64879: quoted_printable_encode() wrong size calculation (CVE-2013-2110) +--FILE-- +<?php + +quoted_printable_encode(str_repeat("\xf4", 1000)); +quoted_printable_encode(str_repeat("\xf4", 100000)); + +echo "Done\n"; +?> +--EXPECTF-- +Done diff --git a/ext/standard/tests/strings/chop_variation1.phpt b/ext/standard/tests/strings/chop_variation1.phpt index de5ecd816..bb5bca4ec 100644 --- a/ext/standard/tests/strings/chop_variation1.phpt +++ b/ext/standard/tests/strings/chop_variation1.phpt @@ -82,7 +82,7 @@ $values = array ( // loop through each element of the array and check the working of chop() -// when $str arugment is supplied with different values +// when $str argument is supplied with different values echo "\n--- Testing chop() by supplying different values for 'str' argument ---\n"; $counter = 1; diff --git a/ext/standard/tests/strings/chop_variation2.phpt b/ext/standard/tests/strings/chop_variation2.phpt index f0416e77b..02d32306e 100644 --- a/ext/standard/tests/strings/chop_variation2.phpt +++ b/ext/standard/tests/strings/chop_variation2.phpt @@ -82,7 +82,7 @@ $values = array ( // loop through each element of the array and check the working of chop() -// when $charlist arugment is supplied with different values +// when $charlist argument is supplied with different values echo "\n--- Testing chop() by supplying different values for 'charlist' argument ---\n"; $counter = 1; diff --git a/ext/standard/tests/strings/chunk_split_error.phpt b/ext/standard/tests/strings/chunk_split_error.phpt index 9313b65b5..341f04ffd 100644 --- a/ext/standard/tests/strings/chunk_split_error.phpt +++ b/ext/standard/tests/strings/chunk_split_error.phpt @@ -10,7 +10,7 @@ Test chunk_split() function : error conditions /* * Testing error conditions of chunk_split() with zero arguments -* and for more than expected number of argments +* and for more than expected number of arguments */ echo "*** Testing chunk_split() : error conditions ***\n"; diff --git a/ext/standard/tests/strings/explode_error.phpt b/ext/standard/tests/strings/explode_error.phpt index f7342e7ad..e88b1b0c6 100644 --- a/ext/standard/tests/strings/explode_error.phpt +++ b/ext/standard/tests/strings/explode_error.phpt @@ -14,11 +14,11 @@ echo "\n-- Testing explode() function with no arguments --\n"; var_dump( explode() ); echo "\n-- Testing explode() function with more than expected no. of arguments --\n"; -$delimeter = " "; +$delimiter = " "; $string = "piece1 piece2 piece3 piece4 piece5 piece6"; $limit = 5; $extra_arg = 10; -var_dump( explode($delimeter, $string, $limit, $extra_arg) ); +var_dump( explode($delimiter, $string, $limit, $extra_arg) ); ?> ===Done=== diff --git a/ext/standard/tests/strings/explode_variation1.phpt b/ext/standard/tests/strings/explode_variation1.phpt index 9c9ce1169..f16f69bec 100644 --- a/ext/standard/tests/strings/explode_variation1.phpt +++ b/ext/standard/tests/strings/explode_variation1.phpt @@ -24,8 +24,8 @@ class sample { //getting the resource $file_handle = fopen(__FILE__, "r"); -// array with different values for $delimeter -$delimeters = array ( +// array with different values for $delimiter +$delimiters = array ( // integer values /*1*/ 0, @@ -68,13 +68,13 @@ $delimeters = array ( /*22*/ @$unset_var ); -// loop through with each element of the $delimeters array to test explode() function +// loop through with each element of the $delimiters array to test explode() function $count = 1; $string = "piece1 piece2 piece3 piece4 piece5 piece6"; $limit = 5; -foreach($delimeters as $delimeter) { +foreach($delimiters as $delimiter) { echo "-- Iteration $count --\n"; - var_dump( explode($delimeter, $string, $limit) ); + var_dump( explode($delimiter, $string, $limit) ); $count ++; } diff --git a/ext/standard/tests/strings/explode_variation2.phpt b/ext/standard/tests/strings/explode_variation2.phpt index 9e1f72c5a..4de4637ac 100644 --- a/ext/standard/tests/strings/explode_variation2.phpt +++ b/ext/standard/tests/strings/explode_variation2.phpt @@ -70,11 +70,11 @@ $strings = array ( // loop through with each element of the $strings array to test explode() function $count = 1; -$delimeter = " "; +$delimiter = " "; $limit = 5; foreach($strings as $string) { echo "-- Iteration $count --\n"; - var_dump( explode($delimeter, $string, $limit) ); + var_dump( explode($delimiter, $string, $limit) ); $count ++; } diff --git a/ext/standard/tests/strings/explode_variation3.phpt b/ext/standard/tests/strings/explode_variation3.phpt index 54d5222ca..2e8789310 100644 --- a/ext/standard/tests/strings/explode_variation3.phpt +++ b/ext/standard/tests/strings/explode_variation3.phpt @@ -24,7 +24,7 @@ class sample { //getting the resource $file_handle = fopen(__FILE__, "r"); -// array with different values for $delimeter +// array with different values for $delimiter $limits = array ( // integer values @@ -70,11 +70,11 @@ $limits = array ( // loop through with each element of the $limits array to test explode() function $count = 1; -$delimeter = " "; +$delimiter = " "; $string = "piece1 piece2 piece3 piece4 piece5 piece6"; foreach($limits as $limit) { echo "-- Iteration $count --\n"; - var_dump( explode($delimeter, $string, $limit) ); + var_dump( explode($delimiter, $string, $limit) ); $count ++; } diff --git a/ext/standard/tests/strings/get_html_translation_table_variation1.phpt b/ext/standard/tests/strings/get_html_translation_table_variation1.phpt index 7f7e22935..76d590c35 100644 --- a/ext/standard/tests/strings/get_html_translation_table_variation1.phpt +++ b/ext/standard/tests/strings/get_html_translation_table_variation1.phpt @@ -65,7 +65,7 @@ $values = array ( // loop through each element of the array and check the working of get_html_translation_table() -// when $table arugment is supplied with different values +// when $table argument is supplied with different values echo "\n--- Testing get_html_translation_table() by supplying different values for 'table' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/get_html_translation_table_variation2.phpt b/ext/standard/tests/strings/get_html_translation_table_variation2.phpt index b792a5554..ea42af996 100644 --- a/ext/standard/tests/strings/get_html_translation_table_variation2.phpt +++ b/ext/standard/tests/strings/get_html_translation_table_variation2.phpt @@ -68,7 +68,7 @@ $values = array ( // loop through each element of the array and check the working of get_html_translation_table() -// when $quote_style arugment is supplied with different values +// when $quote_style argument is supplied with different values echo "\n--- Testing get_html_translation_table() by supplying different values for 'quote_style' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt b/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt index b15307614..b36556f1a 100644 --- a/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt +++ b/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt @@ -30,7 +30,7 @@ $multiline_string = <<<EOT "This is a double quoted string" EOT; -// heredoc with diferent whitespaces +// heredoc with different whitespaces $diff_whitespaces = <<<EOT <html>Roy's height\r > Sam\t's height 1111\t\t & 0000\v\v = \f0000 diff --git a/ext/standard/tests/strings/implode1.phpt b/ext/standard/tests/strings/implode1.phpt Binary files differindex 4d3502f18..3997c54b5 100644 --- a/ext/standard/tests/strings/implode1.phpt +++ b/ext/standard/tests/strings/implode1.phpt diff --git a/ext/standard/tests/strings/join_variation1.phpt b/ext/standard/tests/strings/join_variation1.phpt index 02bcf3440..e2635f05f 100644 --- a/ext/standard/tests/strings/join_variation1.phpt +++ b/ext/standard/tests/strings/join_variation1.phpt @@ -84,7 +84,7 @@ $values = array ( // loop through each element of the array and check the working of join() -// when $glue arugment is supplied with different values +// when $glue argument is supplied with different values echo "\n--- Testing join() by supplying different values for 'glue' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/join_variation2.phpt b/ext/standard/tests/strings/join_variation2.phpt index 50395f176..46e91afd3 100644 --- a/ext/standard/tests/strings/join_variation2.phpt +++ b/ext/standard/tests/strings/join_variation2.phpt @@ -82,7 +82,7 @@ $values = array ( // loop through each element of the array and check the working of join() -// when $pieces arugment is supplied with different values +// when $pieces argument is supplied with different values echo "\n--- Testing join() by supplying different values for 'pieces' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/lcfirst.phpt b/ext/standard/tests/strings/lcfirst.phpt Binary files differindex 4c5bec898..e603f4bbf 100644 --- a/ext/standard/tests/strings/lcfirst.phpt +++ b/ext/standard/tests/strings/lcfirst.phpt diff --git a/ext/standard/tests/strings/setlocale_basic1.phpt b/ext/standard/tests/strings/setlocale_basic1.phpt index 957357f6c..c806e6fab 100644 --- a/ext/standard/tests/strings/setlocale_basic1.phpt +++ b/ext/standard/tests/strings/setlocale_basic1.phpt @@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "en_AU.utf8", "ko_KR.utf8", "zh_CN.utf8", "d /* Prototype : string setlocale (int $category , string $locale [,string $..] ) : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , - * or FALSE if locale functinality is not implemented in this platform. + * or FALSE if locale functionality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_basic2.phpt b/ext/standard/tests/strings/setlocale_basic2.phpt index fe61b9b43..7204c4591 100644 --- a/ext/standard/tests/strings/setlocale_basic2.phpt +++ b/ext/standard/tests/strings/setlocale_basic2.phpt @@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "en_AU.utf8", "ko_KR.utf8", "zh_CN.utf8", "d /* Prototype : string setlocale (int $category , string $locale [,string $..] ) : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , or FALSE - if locale functinality is not implemented in this platform. + if locale functionality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_basic3.phpt b/ext/standard/tests/strings/setlocale_basic3.phpt index 47917e34e..997dad98e 100644 --- a/ext/standard/tests/strings/setlocale_basic3.phpt +++ b/ext/standard/tests/strings/setlocale_basic3.phpt @@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "Ko_KR.utf8", "zh_CN.utf8") === false) { /* Prototype : string setlocale (int $category , string $locale [,string $..] ) : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , or FALSE - if locale functinality is not implemented in this platform. + if locale functionality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_error.phpt b/ext/standard/tests/strings/setlocale_error.phpt index e3f3765fb..361d00c58 100644 --- a/ext/standard/tests/strings/setlocale_error.phpt +++ b/ext/standard/tests/strings/setlocale_error.phpt @@ -12,7 +12,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { <?php /* Prototype : string setlocale (int $category , string $locale [,string $..] ) : string setlocale(int $category , array $locale); - * Description: Sets locale information.Returns the new current locale , or FALSE if locale functinality is not implemented in this platform. + * Description: Sets locale information.Returns the new current locale , or FALSE if locale functionality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_variation1.phpt b/ext/standard/tests/strings/setlocale_variation1.phpt index 5e21d0b79..04665b545 100644 --- a/ext/standard/tests/strings/setlocale_variation1.phpt +++ b/ext/standard/tests/strings/setlocale_variation1.phpt @@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "Ko_KR.utf8", "zh_CN.utf8") === false) { /* Prototype : string setlocale (int $category , string $locale [,string $..] ) : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , or FALSE - if locale functinality is not implemented in this platform. + if locale functionality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt index af8739a76..038ba58c5 100644 --- a/ext/standard/tests/strings/setlocale_variation2.phpt +++ b/ext/standard/tests/strings/setlocale_variation2.phpt @@ -11,7 +11,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { /* Prototype : string setlocale (int $category , string $locale [,string $..] ) : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , or FALSE - if locale functinality is not implemented in this platform. + if locale functionality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_variation3.phpt b/ext/standard/tests/strings/setlocale_variation3.phpt index 09d6c1186..44cbe1bda 100644 --- a/ext/standard/tests/strings/setlocale_variation3.phpt +++ b/ext/standard/tests/strings/setlocale_variation3.phpt @@ -14,7 +14,7 @@ if (setlocale(LC_ALL,'en_US.utf8') === false) { /* Prototype : string setlocale (int $category , string $locale [,string $..] ) * : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , or FALSE - * if locale functinality is not implemented in this platform. + * if locale functionality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_variation4.phpt b/ext/standard/tests/strings/setlocale_variation4.phpt index 4ab1db7ad..7b27c106d 100644 --- a/ext/standard/tests/strings/setlocale_variation4.phpt +++ b/ext/standard/tests/strings/setlocale_variation4.phpt @@ -16,7 +16,7 @@ LC_ALL=en_US.utf8; /* Prototype : string setlocale (int $category , string $locale [,string $..] ) * : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , or FALSE - * if locale functinality is not implemented in this platform. + * if locale functionality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_variation5.phpt b/ext/standard/tests/strings/setlocale_variation5.phpt index c8e947b09..40eda3780 100644 --- a/ext/standard/tests/strings/setlocale_variation5.phpt +++ b/ext/standard/tests/strings/setlocale_variation5.phpt @@ -16,7 +16,7 @@ LC_ALL=en_US.utf8; /* Prototype : string setlocale (int $category , string $locale [,string $..] ) * : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , or FALSE - * if locale functinality is not implemented in this platform. + * if locale functionality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/str_replace.phpt b/ext/standard/tests/strings/str_replace.phpt index 830378b9a..15c1c8e53 100644 --- a/ext/standard/tests/strings/str_replace.phpt +++ b/ext/standard/tests/strings/str_replace.phpt @@ -120,7 +120,7 @@ var_dump($count); echo "\n-- Testing objects --\n"; /* we get "Catchable fatal error: saying Object of class could not be converted to string" by default, when an object is passed instead of string: -The error can be avoided by chosing the __toString magix method as follows: */ +The error can be avoided by choosing the __toString magix method as follows: */ class subject { diff --git a/ext/standard/tests/strings/str_replace_variation3.phpt b/ext/standard/tests/strings/str_replace_variation3.phpt index 9b19153fa..7b46f8b28 100644 --- a/ext/standard/tests/strings/str_replace_variation3.phpt +++ b/ext/standard/tests/strings/str_replace_variation3.phpt @@ -33,7 +33,7 @@ var_dump($count); echo "\n-- Testing objects --\n"; /* we get "Catchable fatal error: saying Object of class could not be converted to string" by default, when an object is passed instead of string: -The error can be avoided by chosing the __toString magix method as follows: */ +The error can be avoided by choosing the __toString magix method as follows: */ class subject { diff --git a/ext/standard/tests/strings/strcasecmp.phpt b/ext/standard/tests/strings/strcasecmp.phpt Binary files differindex 33694f987..b3452cfd7 100644 --- a/ext/standard/tests/strings/strcasecmp.phpt +++ b/ext/standard/tests/strings/strcasecmp.phpt diff --git a/ext/standard/tests/strings/strcmp.phpt b/ext/standard/tests/strings/strcmp.phpt Binary files differindex 069388011..e77ed6e46 100644 --- a/ext/standard/tests/strings/strcmp.phpt +++ b/ext/standard/tests/strings/strcmp.phpt diff --git a/ext/standard/tests/strings/strcspn_variation2.phpt b/ext/standard/tests/strings/strcspn_variation2.phpt index cb7544c2a..c21af6f25 100644 --- a/ext/standard/tests/strings/strcspn_variation2.phpt +++ b/ext/standard/tests/strings/strcspn_variation2.phpt @@ -15,7 +15,7 @@ error_reporting(E_ALL & ~E_NOTICE); * Testing strcspn() : with different unexpected values for mask argument */ -echo "*** Testing strcspn() : with diferent unexpected values of mask argument ***\n"; +echo "*** Testing strcspn() : with different unexpected values of mask argument ***\n"; $str = 'string_val'; $start = 1; @@ -102,7 +102,7 @@ fclose($file_handle); echo "Done" ?> --EXPECTF-- -*** Testing strcspn() : with diferent unexpected values of mask argument *** +*** Testing strcspn() : with different unexpected values of mask argument *** -- Iteration with mask value as "0" -- int(10) diff --git a/ext/standard/tests/strings/strip_tags_variation5.phpt b/ext/standard/tests/strings/strip_tags_variation5.phpt index 54601e9b6..20b569390 100644 --- a/ext/standard/tests/strings/strip_tags_variation5.phpt +++ b/ext/standard/tests/strings/strip_tags_variation5.phpt @@ -33,7 +33,7 @@ $multiline_string = <<<EOT <b>This is a double quoted string</b> EOT; -// here doc with diferent whitespaces +// here doc with different whitespaces $diff_whitespaces = <<<EOT <html>hello\r world\t 1111\t\t != 2222\v\v</html> diff --git a/ext/standard/tests/strings/stripcslashes_variation1.phpt b/ext/standard/tests/strings/stripcslashes_variation1.phpt index 32c8963df..a2754c610 100644 --- a/ext/standard/tests/strings/stripcslashes_variation1.phpt +++ b/ext/standard/tests/strings/stripcslashes_variation1.phpt @@ -81,7 +81,7 @@ $values = array ( // loop through each element of the array and check the working of stripcslashes() -// when $str arugment is supplied with different values +// when $str argument is supplied with different values echo "\n--- Testing stripcslashes() by supplying different values for 'str' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/stripslashes_variation1.phpt b/ext/standard/tests/strings/stripslashes_variation1.phpt index 5693a26ef..fb104199b 100644 --- a/ext/standard/tests/strings/stripslashes_variation1.phpt +++ b/ext/standard/tests/strings/stripslashes_variation1.phpt @@ -80,7 +80,7 @@ $values = array ( // loop through each element of the array and check the working of stripslashes() -// when $str arugment is supplied with different values +// when $str argument is supplied with different values echo "\n--- Testing stripslashes() by supplying different values for 'str' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/strlen.phpt b/ext/standard/tests/strings/strlen.phpt Binary files differindex 5a1114d5c..df39f2469 100644 --- a/ext/standard/tests/strings/strlen.phpt +++ b/ext/standard/tests/strings/strlen.phpt diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt Binary files differindex 9b44584ee..44785ef6c 100644 --- a/ext/standard/tests/strings/strpos.phpt +++ b/ext/standard/tests/strings/strpos.phpt diff --git a/ext/standard/tests/strings/strrchr_basic.phpt b/ext/standard/tests/strings/strrchr_basic.phpt index f39683483..b5bfe2d9c 100644 --- a/ext/standard/tests/strings/strrchr_basic.phpt +++ b/ext/standard/tests/strings/strrchr_basic.phpt @@ -30,11 +30,11 @@ var_dump( strrchr("Hello, World", "Hello, World") ); //needle as haystack //needle string containing one existing and one non-existing char var_dump( strrchr("Hello, World", "Hi") ); -//multiple existance of needle in haystack +//multiple existence of needle in haystack var_dump( strrchr("Hello, World", "o") ); var_dump( strrchr("Hello, World", "ooo") ); -var_dump( strrchr("Hello, World", "Zzzz") ); //non-existant needle in haystack +var_dump( strrchr("Hello, World", "Zzzz") ); //non-existent needle in haystack echo "*** Done ***"; ?> --EXPECTF-- diff --git a/ext/standard/tests/strings/strspn_variation2.phpt b/ext/standard/tests/strings/strspn_variation2.phpt index 7af61e559..57929fa35 100644 --- a/ext/standard/tests/strings/strspn_variation2.phpt +++ b/ext/standard/tests/strings/strspn_variation2.phpt @@ -15,7 +15,7 @@ error_reporting(E_ALL & ~E_NOTICE); * Testing strspn() : with different unexpected values for mask argument */ -echo "*** Testing strspn() : with diferent unexpected values of mask argument ***\n"; +echo "*** Testing strspn() : with different unexpected values of mask argument ***\n"; $str = 'string_val'; $start = 1; @@ -102,7 +102,7 @@ fclose($file_handle); echo "Done" ?> --EXPECTF-- -*** Testing strspn() : with diferent unexpected values of mask argument *** +*** Testing strspn() : with different unexpected values of mask argument *** -- Iteration with mask value as "0" -- int(0) diff --git a/ext/standard/tests/strings/strstr.phpt b/ext/standard/tests/strings/strstr.phpt Binary files differindex b135258f8..bdedb7e9f 100644 --- a/ext/standard/tests/strings/strstr.phpt +++ b/ext/standard/tests/strings/strstr.phpt diff --git a/ext/standard/tests/strings/strtok_variation1.phpt b/ext/standard/tests/strings/strtok_variation1.phpt index b8febacfb..cb06fc43c 100644 --- a/ext/standard/tests/strings/strtok_variation1.phpt +++ b/ext/standard/tests/strings/strtok_variation1.phpt @@ -81,7 +81,7 @@ $values = array ( // loop through each element of the array and check the working of strtok() -// when $str arugment is supplied with different values +// when $str argument is supplied with different values echo "\n--- Testing strtok() by supplying different values for 'str' argument ---\n"; $counter = 1; diff --git a/ext/standard/tests/strings/strtok_variation2.phpt b/ext/standard/tests/strings/strtok_variation2.phpt index 19a6f26fb..13da44058 100644 --- a/ext/standard/tests/strings/strtok_variation2.phpt +++ b/ext/standard/tests/strings/strtok_variation2.phpt @@ -81,7 +81,7 @@ $values = array ( // loop through each element of the array and check the working of strtok() -// when $token arugment is supplied with different values +// when $token argument is supplied with different values echo "\n--- Testing strtok() by supplying different values for 'token' argument ---\n"; $counter = 1; diff --git a/ext/standard/tests/strings/substr_replace_error.phpt b/ext/standard/tests/strings/substr_replace_error.phpt index 7d3a695d4..fd314cbd9 100644 --- a/ext/standard/tests/strings/substr_replace_error.phpt +++ b/ext/standard/tests/strings/substr_replace_error.phpt @@ -26,7 +26,7 @@ echo "\n-- Testing substr_replace() function with start and length different typ var_dump(substr_replace($s1, "evening", array(5))); var_dump(substr_replace($s1, "evening", 5, array(8))); -echo "\n-- Testing substr_replace() function with start and length with a different number of elments --\n"; +echo "\n-- Testing substr_replace() function with start and length with a different number of elements --\n"; var_dump(substr_replace($s1, "evening", array(5, 1), array(8))); echo "\n-- Testing substr_replace() function with start and length as arrays but string not--\n"; @@ -58,7 +58,7 @@ string(12) "Good morning" Warning: substr_replace(): 'from' and 'len' should be of same type - numerical or array in %s on line %d string(12) "Good morning" --- Testing substr_replace() function with start and length with a different number of elments -- +-- Testing substr_replace() function with start and length with a different number of elements -- Warning: substr_replace(): 'from' and 'len' should have the same number of elements in %s on line %d string(12) "Good morning" diff --git a/ext/standard/tests/strings/trim1.phpt b/ext/standard/tests/strings/trim1.phpt Binary files differindex b9323afbd..dd52efd98 100644 --- a/ext/standard/tests/strings/trim1.phpt +++ b/ext/standard/tests/strings/trim1.phpt diff --git a/ext/standard/tests/strings/trim_error.phpt b/ext/standard/tests/strings/trim_error.phpt index 092deb6dc..51dc848c9 100644 --- a/ext/standard/tests/strings/trim_error.phpt +++ b/ext/standard/tests/strings/trim_error.phpt @@ -4,7 +4,7 @@ Test trim() function : error conditions <?php /* Prototype : string trim ( string $str [, string $charlist ] ) - * Description: Strip whitespace (or other characters) from the begining and end of a string. + * Description: Strip whitespace (or other characters) from the beginning and end of a string. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/trim_variation1.phpt b/ext/standard/tests/strings/trim_variation1.phpt index 625ec3182..4ef40c680 100644 --- a/ext/standard/tests/strings/trim_variation1.phpt +++ b/ext/standard/tests/strings/trim_variation1.phpt @@ -4,7 +4,7 @@ Test trim() function : usage variations - test values for $str argument <?php /* Prototype : string trim ( string $str [, string $charlist ] ) - * Description: Strip whitespace (or other characters) from the begining and end of a string. + * Description: Strip whitespace (or other characters) from the beginning and end of a string. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/trim_variation2.phpt b/ext/standard/tests/strings/trim_variation2.phpt index 009d61b2d..11b2aaf1c 100644 --- a/ext/standard/tests/strings/trim_variation2.phpt +++ b/ext/standard/tests/strings/trim_variation2.phpt @@ -4,7 +4,7 @@ Test trim() function : usage variations - test values for $charlist argument <?php /* Prototype : string trim ( string $str [, string $charlist ] ) - * Description: Strip whitespace (or other characters) from the begining and end of a string. + * Description: Strip whitespace (or other characters) from the beginning and end of a string. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/ucfirst.phpt b/ext/standard/tests/strings/ucfirst.phpt Binary files differindex bae40955d..468f7f034 100644 --- a/ext/standard/tests/strings/ucfirst.phpt +++ b/ext/standard/tests/strings/ucfirst.phpt diff --git a/ext/standard/tests/strings/ucwords_variation1.phpt b/ext/standard/tests/strings/ucwords_variation1.phpt index 22c29163c..02edf0513 100644 --- a/ext/standard/tests/strings/ucwords_variation1.phpt +++ b/ext/standard/tests/strings/ucwords_variation1.phpt @@ -94,7 +94,7 @@ $values = array ( ); // loop through each element of the array and check the working of ucwords() -// when $str arugment is supplied with different values +// when $str argument is supplied with different values echo "\n--- Testing ucwords() by supplying different values for 'str' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/ucwords_variation2.phpt b/ext/standard/tests/strings/ucwords_variation2.phpt index ab6eb2f45..4c24d97a0 100644 --- a/ext/standard/tests/strings/ucwords_variation2.phpt +++ b/ext/standard/tests/strings/ucwords_variation2.phpt @@ -29,7 +29,7 @@ multiline string using heredoc EOT; -// here doc with diferent whitespaces +// here doc with different whitespaces $diff_whitespaces = <<<EOT testing\rucword(str)\twith multiline string\t\tusing diff --git a/ext/standard/tests/strings/wordwrap_variation1.phpt b/ext/standard/tests/strings/wordwrap_variation1.phpt index d13e7dee2..28fc128bb 100644 --- a/ext/standard/tests/strings/wordwrap_variation1.phpt +++ b/ext/standard/tests/strings/wordwrap_variation1.phpt @@ -75,7 +75,7 @@ $values = array ( ); // loop though each element of the array and check the working of wordwrap() -// when $str arugment is supplied with different values +// when $str argument is supplied with different values echo "\n--- Testing wordwrap() by supplying different values for 'str' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/wordwrap_variation2.phpt b/ext/standard/tests/strings/wordwrap_variation2.phpt index 271879194..b914a2a81 100644 --- a/ext/standard/tests/strings/wordwrap_variation2.phpt +++ b/ext/standard/tests/strings/wordwrap_variation2.phpt @@ -73,7 +73,7 @@ $values = array ( // loop though each element of the array and check the working of wordwrap() -// when $width arugment is supplied with different values +// when $width argument is supplied with different values echo "\n--- Testing wordwrap() by supplying different values for 'width' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/wordwrap_variation3.phpt b/ext/standard/tests/strings/wordwrap_variation3.phpt index 7d0c81670..ddf04c77c 100644 --- a/ext/standard/tests/strings/wordwrap_variation3.phpt +++ b/ext/standard/tests/strings/wordwrap_variation3.phpt @@ -75,7 +75,7 @@ $values = array ( ); // loop though each element of the array and check the working of wordwrap() -// when $break arugment is supplied with different values +// when $break argument is supplied with different values echo "\n--- Testing wordwrap() by supplying different values for 'break' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/wordwrap_variation4.phpt b/ext/standard/tests/strings/wordwrap_variation4.phpt index 440e93740..7111f2d2b 100644 --- a/ext/standard/tests/strings/wordwrap_variation4.phpt +++ b/ext/standard/tests/strings/wordwrap_variation4.phpt @@ -66,7 +66,7 @@ $values = array ( ); // loop though each element of the array and check the working of wordwrap() -// when $cut arugment is supplied with different values +// when $cut argument is supplied with different values echo "\n--- Testing wordwrap() by supplying different values for 'cut' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/url.c b/ext/standard/url.c index 94f6638d6..190b4665e 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -266,7 +266,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) p = s; } else { /* memrchr is a GNU specific extension - Emulate for wide compatability */ + Emulate for wide compatibility */ for(p = e; *p != ':' && p >= s; p--); } diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 2ceda1383..ae55d656d 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Tue Jan 1 16:28:14 2013 */ +/* Generated by re2c 0.13.5 */ /* +----------------------------------------------------------------------+ | PHP Version 5 | @@ -717,139 +717,112 @@ state_val: { YYCTYPE yych; static const unsigned char yybm[] = { - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 160, 160, 248, 248, 160, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 160, 248, 56, 248, 248, 248, 248, 200, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 0, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 192, 192, 224, 224, 192, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 192, 224, 64, 224, 224, 224, 224, 128, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 0, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, }; - if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; if (yych <= ' ') { if (yych <= '\f') { if (yych <= 0x08) goto yy63; - if (yych <= '\n') goto yy64; + if (yych <= '\n') goto yy65; goto yy63; } else { - if (yych <= '\r') goto yy64; + if (yych <= '\r') goto yy65; if (yych <= 0x1F) goto yy63; - goto yy64; + goto yy65; } } else { if (yych <= '&') { if (yych != '"') goto yy63; } else { if (yych <= '\'') goto yy62; - if (yych == '>') goto yy64; + if (yych == '>') goto yy65; goto yy63; } } yych = *(YYMARKER = ++YYCURSOR); - goto yy77; + if (yych != '>') goto yy74; yy61: - { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } + { passthru(STD_ARGS); goto state_next_arg_begin; } yy62: yych = *(YYMARKER = ++YYCURSOR); + if (yych == '>') goto yy61; goto yy69; yy63: - yych = *++YYCURSOR; + ++YYCURSOR; + yych = *YYCURSOR; goto yy67; yy64: - ++YYCURSOR; - { passthru(STD_ARGS); goto state_next_arg_begin; } + { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } +yy65: + yych = *++YYCURSOR; + goto yy61; yy66: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy67: - if (yybm[0+yych] & 8) { + if (yybm[0+yych] & 32) { goto yy66; } - goto yy61; + goto yy64; yy68: - YYMARKER = ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; -yy69: - if (yybm[0+yych] & 16) { - goto yy68; - } - if (yych <= '&') goto yy72; - if (yych >= '(') goto yy61; - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 8) { - goto yy66; - } -yy71: - { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } -yy72: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yybm[0+yych] & 32) { - goto yy72; +yy69: + if (yybm[0+yych] & 64) { + goto yy68; } - if (yych <= '=') goto yy75; -yy74: + if (yych <= '=') goto yy71; +yy70: YYCURSOR = YYMARKER; goto yy61; -yy75: - yych = *++YYCURSOR; - goto yy71; -yy76: - YYMARKER = ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; -yy77: - if (yybm[0+yych] & 64) { - goto yy76; - } - if (yych <= '!') goto yy80; - if (yych >= '#') goto yy61; +yy71: ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 8) { - goto yy66; - } -yy79: - { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } -yy80: + { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } +yy73: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; +yy74: if (yybm[0+yych] & 128) { - goto yy80; + goto yy73; } - if (yych >= '>') goto yy74; + if (yych >= '>') goto yy70; ++YYCURSOR; - yych = *YYCURSOR; - goto yy79; + { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } } diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index 760f725e9..ecacb76f9 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -317,7 +317,7 @@ state_next_arg_begin: state_next_arg: start = YYCURSOR; /*!re2c - ">" { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } + [/]? [>] { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } [ \v\r\t\n]+ { passthru(STD_ARGS); goto state_next_arg; } alpha { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } any { passthru(STD_ARGS); goto state_plain_begin; } @@ -343,7 +343,7 @@ state_val: /*!re2c ["] (any\[">])* ["] { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } ['] (any\['>])* ['] { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } - (any\[ \r\t\n>])+ { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } + (any\[ \r\t\n>'"])+ { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } any { passthru(STD_ARGS); goto state_next_arg_begin; } */ @@ -463,7 +463,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char * PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC) { - char *encoded; + char *encoded = NULL; int encoded_len; smart_str val; diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index b009e67aa..b44be124a 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -474,7 +474,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS) } else { php_stream_bucket_prepend(brigade, bucket TSRMLS_CC); } - /* This is a hack necessary to accomodate situations where bucket is appended to the stream + /* This is a hack necessary to accommodate situations where bucket is appended to the stream * multiple times. See bug35916.phpt for reference. */ if (bucket->refcount == 1) { diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index f0142ed04..76701ff24 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -70,7 +70,7 @@ PHPAPI int php_uuencode(char *src, int src_len, char **dest) /* {{{ */ int len = 45; char *p, *s, *e, *ee; - /* encoded length is ~ 38% greater then the original */ + /* encoded length is ~ 38% greater than the original */ p = *dest = safe_emalloc((size_t) ceil(src_len * 1.38), 1, 46); s = src; e = src + src_len; diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index d2f57b34f..136af2171 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sat Mar 9 22:33:09 2013 */ +/* Generated by re2c 0.13.5 on Mon Jul 29 17:57:26 2013 */ /* +----------------------------------------------------------------------+ | PHP Version 5 | @@ -25,6 +25,7 @@ /* {{{ reference-handling for unserializer: var_* */ #define VAR_ENTRIES_MAX 1024 +#define VAR_ENTRIES_DBG 0 typedef struct { zval *data[VAR_ENTRIES_MAX]; @@ -35,7 +36,7 @@ typedef struct { static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -59,7 +60,7 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last_dtor; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -81,11 +82,35 @@ PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) var_hash->data[var_hash->used_slots++] = *rval; } +PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval) +{ + var_entries *var_hash = (*var_hashx)->last_dtor; +#if VAR_ENTRIES_DBG + fprintf(stderr, "var_push_dtor_no_addref(%ld): %d (%d)\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval), Z_REFCOUNT_PP(rval)); +#endif + + if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) { + var_hash = emalloc(sizeof(var_entries)); + var_hash->used_slots = 0; + var_hash->next = 0; + + if (!(*var_hashx)->first_dtor) { + (*var_hashx)->first_dtor = var_hash; + } else { + ((var_entries *) (*var_hashx)->last_dtor)->next = var_hash; + } + + (*var_hashx)->last_dtor = var_hash; + } + + var_hash->data[var_hash->used_slots++] = *rval; +} + PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) { long i; var_entries *var_hash = (*var_hashx)->first; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval)); #endif @@ -103,7 +128,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **n static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store) { var_entries *var_hash = (*var_hashx)->first; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_access(%ld): %ld\n", var_hash?var_hash->used_slots:-1L, id); #endif @@ -126,7 +151,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) void *next; long i; var_entries *var_hash = (*var_hashx)->first; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L); #endif @@ -617,9 +642,9 @@ yy20: do { /* Try to find class directly */ - BG(serialize_lock) = 1; + BG(serialize_lock)++; if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - BG(serialize_lock) = 0; + BG(serialize_lock)--; if (EG(exception)) { efree(class_name); return 0; @@ -627,7 +652,7 @@ yy20: ce = *pce; break; } - BG(serialize_lock) = 0; + BG(serialize_lock)--; if (EG(exception)) { efree(class_name); @@ -647,9 +672,9 @@ yy20: args[0] = &arg_func_name; MAKE_STD_ZVAL(arg_func_name); ZVAL_STRING(arg_func_name, class_name, 1); - BG(serialize_lock) = 1; + BG(serialize_lock)++; if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { - BG(serialize_lock) = 0; + BG(serialize_lock)--; if (EG(exception)) { efree(class_name); zval_ptr_dtor(&user_func); @@ -663,7 +688,7 @@ yy20: zval_ptr_dtor(&arg_func_name); break; } - BG(serialize_lock) = 0; + BG(serialize_lock)--; if (retval_ptr) { zval_ptr_dtor(&retval_ptr); } @@ -691,7 +716,9 @@ yy20: *p = YYCURSOR; if (custom_object) { - int ret = object_custom(UNSERIALIZE_PASSTHRU, ce); + int ret; + + ret = object_custom(UNSERIALIZE_PASSTHRU, ce); if (ret && incomplete_class) { php_store_class_name(*rval, class_name, len2); @@ -1151,7 +1178,7 @@ yy91: if (*rval == *rval_ref) return 0; if (*rval != NULL) { - zval_ptr_dtor(rval); + var_push_dtor_no_addref(var_hash, rval); } *rval = *rval_ref; Z_ADDREF_PP(rval); diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 4d99cbfd7..76c501e1b 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -24,6 +24,7 @@ /* {{{ reference-handling for unserializer: var_* */ #define VAR_ENTRIES_MAX 1024 +#define VAR_ENTRIES_DBG 0 typedef struct { zval *data[VAR_ENTRIES_MAX]; @@ -34,7 +35,7 @@ typedef struct { static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -58,7 +59,7 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last_dtor; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -80,11 +81,35 @@ PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) var_hash->data[var_hash->used_slots++] = *rval; } +PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval) +{ + var_entries *var_hash = (*var_hashx)->last_dtor; +#if VAR_ENTRIES_DBG + fprintf(stderr, "var_push_dtor_no_addref(%ld): %d (%d)\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval), Z_REFCOUNT_PP(rval)); +#endif + + if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) { + var_hash = emalloc(sizeof(var_entries)); + var_hash->used_slots = 0; + var_hash->next = 0; + + if (!(*var_hashx)->first_dtor) { + (*var_hashx)->first_dtor = var_hash; + } else { + ((var_entries *) (*var_hashx)->last_dtor)->next = var_hash; + } + + (*var_hashx)->last_dtor = var_hash; + } + + var_hash->data[var_hash->used_slots++] = *rval; +} + PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) { long i; var_entries *var_hash = (*var_hashx)->first; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval)); #endif @@ -102,7 +127,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **n static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store) { var_entries *var_hash = (*var_hashx)->first; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_access(%ld): %ld\n", var_hash?var_hash->used_slots:-1L, id); #endif @@ -125,7 +150,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) void *next; long i; var_entries *var_hash = (*var_hashx)->first; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L); #endif @@ -472,7 +497,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) if (*rval == *rval_ref) return 0; if (*rval != NULL) { - zval_ptr_dtor(rval); + var_push_dtor_no_addref(var_hash, rval); } *rval = *rval_ref; Z_ADDREF_PP(rval); @@ -683,9 +708,9 @@ object ":" uiv ":" ["] { do { /* Try to find class directly */ - BG(serialize_lock) = 1; + BG(serialize_lock)++; if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - BG(serialize_lock) = 0; + BG(serialize_lock)--; if (EG(exception)) { efree(class_name); return 0; @@ -693,7 +718,7 @@ object ":" uiv ":" ["] { ce = *pce; break; } - BG(serialize_lock) = 0; + BG(serialize_lock)--; if (EG(exception)) { efree(class_name); @@ -713,9 +738,9 @@ object ":" uiv ":" ["] { args[0] = &arg_func_name; MAKE_STD_ZVAL(arg_func_name); ZVAL_STRING(arg_func_name, class_name, 1); - BG(serialize_lock) = 1; + BG(serialize_lock)++; if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { - BG(serialize_lock) = 0; + BG(serialize_lock)--; if (EG(exception)) { efree(class_name); zval_ptr_dtor(&user_func); @@ -729,7 +754,7 @@ object ":" uiv ":" ["] { zval_ptr_dtor(&arg_func_name); break; } - BG(serialize_lock) = 0; + BG(serialize_lock)--; if (retval_ptr) { zval_ptr_dtor(&retval_ptr); } @@ -757,7 +782,9 @@ object ":" uiv ":" ["] { *p = YYCURSOR; if (custom_object) { - int ret = object_custom(UNSERIALIZE_PASSTHRU, ce); + int ret; + + ret = object_custom(UNSERIALIZE_PASSTHRU, ce); if (ret && incomplete_class) { php_store_class_name(*rval, class_name, len2); diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index bd4cf1429..ee53d484c 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -1121,7 +1121,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC) break; case CS_CMD_FAIL: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Command failed, cancelling rest"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Command failed, canceling rest"); ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); fail = 1; break; @@ -1131,7 +1131,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC) case CS_PARAM_RESULT: case CS_ROW_RESULT: /* Unexpected results, cancel them. */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, cancelling current"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, canceling current"); ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_CURRENT); break; @@ -1141,7 +1141,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC) break; default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, cancelling all"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, canceling all"); ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); break; } @@ -1696,7 +1696,7 @@ PHP_FUNCTION(sybase_free_result) /* Did we fetch up until the end? */ if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) { - /* php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cancelling the rest of the results"); */ + /* php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: canceling the rest of the results"); */ ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); php_sybase_finish_results(result TSRMLS_CC); } diff --git a/ext/sybase_ct/tests/bug26407.phpt b/ext/sybase_ct/tests/bug26407.phpt index 35bf6df7a..27f5f99b9 100644 --- a/ext/sybase_ct/tests/bug26407.phpt +++ b/ext/sybase_ct/tests/bug26407.phpt @@ -80,7 +80,7 @@ bool(true) select "bar" -Notice: sybase_query(): Sybase: Unexpected results, cancelling current in %stest.inc on line %d +Notice: sybase_query(): Sybase: Unexpected results, canceling current in %stest.inc on line %d <<< Return: resource array(1) { [0]=> diff --git a/ext/sybase_ct/tests/bug43578.phpt b/ext/sybase_ct/tests/bug43578.phpt index e840402ed..9f75b9c0e 100644 --- a/ext/sybase_ct/tests/bug43578.phpt +++ b/ext/sybase_ct/tests/bug43578.phpt @@ -23,7 +23,7 @@ Sybase-CT bug #43578 (Incurred fault #6 - if returned textfield ist empty) var_dump(sybase_query('insert into #Resource values (123, NULL)', $db)); var_dump(sybase_query('insert into #Resource values (124, "")', $db)); - // Select non-existant + // Select non-existent var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 122')); // Select null diff --git a/ext/sybase_ct/tests/test_fetch_object.phpt b/ext/sybase_ct/tests/test_fetch_object.phpt index c23658fa3..2d225cd9c 100644 --- a/ext/sybase_ct/tests/test_fetch_object.phpt +++ b/ext/sybase_ct/tests/test_fetch_object.phpt @@ -40,7 +40,7 @@ Sybase-CT sybase_fetch_object // Test with object var_export(fetch_object($db, new article())); echo "\n"; - // Test with non-existant class + // Test with non-existent class var_export(fetch_object($db, '***')); echo "\n"; sybase_close($db); diff --git a/ext/sybase_ct/tests/test_msghandler.phpt b/ext/sybase_ct/tests/test_msghandler.phpt index afe97cbef..3189aaac2 100644 --- a/ext/sybase_ct/tests/test_msghandler.phpt +++ b/ext/sybase_ct/tests/test_msghandler.phpt @@ -13,7 +13,7 @@ Sybase-CT server message handler $db= sybase_connect_ex(); - echo 'Nonexistant: '; sybase_set_messagehandler_ex('function_does_not_exist'); + echo 'Nonexistent: '; sybase_set_messagehandler_ex('function_does_not_exist'); echo 'Static method: '; sybase_set_messagehandler_ex(array('sybase', 'static_handler')); echo 'Instance method: '; sybase_set_messagehandler_ex(array(new sybase(), 'handler')); echo 'Lambda function: '; sybase_set_messagehandler_ex(create_function('', 'return FALSE;')); @@ -25,7 +25,7 @@ Sybase-CT server message handler sybase_close($db); ?> --EXPECTF-- -Nonexistant: +Nonexistent: Warning: sybase_set_message_handler() expects parameter 1 to be a valid callback, function 'function_does_not_exist' not found or invalid function name in %stest.inc on line %d NULL Static method: bool(true) diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index e268047b6..a57e25e6c 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -228,7 +228,7 @@ PHP_FUNCTION(msg_stat_queue) /* {{{ proto bool msg_queue_exists(int key) - Check wether a message queue exists */ + Check whether a message queue exists */ PHP_FUNCTION(msg_queue_exists) { long key; diff --git a/ext/sysvsem/tests/sysv.phpt b/ext/sysvsem/tests/sysv.phpt index 3a962be31..6f52f3bd7 100644 --- a/ext/sysvsem/tests/sysv.phpt +++ b/ext/sysvsem/tests/sysv.phpt @@ -23,11 +23,11 @@ echo "Got semaphore $sem_id.\n"; // Accuire semaphore if (! sem_acquire($sem_id)) { - echo "Fail to aquire semaphore $sem_id.\n"; + echo "Fail to acquire semaphore $sem_id.\n"; sem_remove($sem_id); exit; } -echo "Success aquire semaphore $sem_id.\n"; +echo "Success acquire semaphore $sem_id.\n"; $shm_id = shm_attach($SHMKEY, $MEMSIZE); if ($shm_id === FALSE) { @@ -100,7 +100,7 @@ echo "End.\n"; --EXPECTF-- Start. Got semaphore Resource id #%i. -Success aquire semaphore Resource id #%i. +Success acquire semaphore Resource id #%i. Success to attach shared memory : %s. Write var1 to shared memory. Write var2 to shared memory. diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 5cfb16456..c3b9d8c34 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -1443,7 +1443,7 @@ static PHP_FUNCTION(tidy_get_config) /* }}} */ /* {{{ proto int tidy_get_status() - Get status of specfied document. */ + Get status of specified document. */ static PHP_FUNCTION(tidy_get_status) { TIDY_FETCH_OBJECT; diff --git a/ext/xml/compat.c b/ext/xml/compat.c index fbebb635e..c2d4497ba 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -619,109 +619,109 @@ XML_GetErrorCode(XML_Parser parser) } static const XML_Char *const error_mapping[] = { - "No error", - "No memory", - "Invalid document start", - "Empty document", - "Not well-formed (invalid token)", - "Invalid document end", - "Invalid hexadecimal character reference", - "Invalid decimal character reference", - "Invalid character reference", - "Invalid character", - "XML_ERR_CHARREF_AT_EOF", - "XML_ERR_CHARREF_IN_PROLOG", - "XML_ERR_CHARREF_IN_EPILOG", - "XML_ERR_CHARREF_IN_DTD", - "XML_ERR_ENTITYREF_AT_EOF", - "XML_ERR_ENTITYREF_IN_PROLOG", - "XML_ERR_ENTITYREF_IN_EPILOG", - "XML_ERR_ENTITYREF_IN_DTD", - "PEReference at end of document", - "PEReference in prolog", - "PEReference in epilog", - "PEReference: forbidden within markup decl in internal subset", - "XML_ERR_ENTITYREF_NO_NAME", - "EntityRef: expecting ';'", - "PEReference: no name", - "PEReference: expecting ';'", - "Undeclared entity error", - "Undeclared entity warning", - "Unparsed Entity", - "XML_ERR_ENTITY_IS_EXTERNAL", - "XML_ERR_ENTITY_IS_PARAMETER", - "Unknown encoding", - "Unsupported encoding", - "String not started expecting ' or \"", - "String not closed expecting \" or '", - "Namespace declaration error", - "EntityValue: \" or ' expected", - "EntityValue: \" or ' expected", - "< in attribute", - "Attribute not started", - "Attribute not finished", - "Attribute without value", - "Attribute redefined", - "SystemLiteral \" or ' expected", - "SystemLiteral \" or ' expected", - /* "XML_ERR_COMMENT_NOT_STARTED", <= eliminated on purpose */ - "Comment not finished", - "Processing Instruction not started", - "Processing Instruction not finished", - "NOTATION: Name expected here", - "'>' required to close NOTATION declaration", - "'(' required to start ATTLIST enumeration", - "'(' required to start ATTLIST enumeration", - "MixedContentDecl : '|' or ')*' expected", - "XML_ERR_MIXED_NOT_FINISHED", - "ELEMENT in DTD not started", - "ELEMENT in DTD not finished", - "XML declaration not started", - "XML declaration not finished", - "XML_ERR_CONDSEC_NOT_STARTED", - "XML conditional section not closed", - "Content error in the external subset", - "DOCTYPE not finished", - "Sequence ']]>' not allowed in content", - "CDATA not finished", - "Reserved XML Name", - "Space required", - "XML_ERR_SEPARATOR_REQUIRED", - "NmToken expected in ATTLIST enumeration", - "XML_ERR_NAME_REQUIRED", - "MixedContentDecl : '#PCDATA' expected", - "SYSTEM or PUBLIC, the URI is missing", - "PUBLIC, the Public Identifier is missing", - "< required", - "> required", - "</ required", - "= required", - "Mismatched tag", - "Tag not finished", - "standalone accepts only 'yes' or 'no'", - "Invalid XML encoding name", - "Comment must not contain '--' (double-hyphen)", - "Invalid encoding", - "external parsed entities cannot be standalone", - "XML conditional section '[' expected", - "Entity value required", - "chunk is not well balanced", - "extra content at the end of well balanced chunk", - "XML_ERR_ENTITY_CHAR_ERROR", - "PEReferences forbidden in internal subset", - "Detected an entity reference loop", - "XML_ERR_ENTITY_BOUNDARY", - "Invalid URI", - "Fragment not allowed", - "XML_WAR_CATALOG_PI", - "XML_ERR_NO_DTD", - "conditional section INCLUDE or IGNORE keyword expected", /* 95 */ - "Version in XML Declaration missing", /* 96 */ - "XML_WAR_UNKNOWN_VERSION", /* 97 */ - "XML_WAR_LANG_VALUE", /* 98 */ - "XML_WAR_NS_URI", /* 99 */ - "XML_WAR_NS_URI_RELATIVE", /* 100 */ - "Missing encoding in text declaration" /* 101 */ + (const XML_Char *)"No error", + (const XML_Char *)"No memory", + (const XML_Char *)"Invalid document start", + (const XML_Char *)"Empty document", + (const XML_Char *)"Not well-formed (invalid token)", + (const XML_Char *)"Invalid document end", + (const XML_Char *)"Invalid hexadecimal character reference", + (const XML_Char *)"Invalid decimal character reference", + (const XML_Char *)"Invalid character reference", + (const XML_Char *)"Invalid character", + (const XML_Char *)"XML_ERR_CHARREF_AT_EOF", + (const XML_Char *)"XML_ERR_CHARREF_IN_PROLOG", + (const XML_Char *)"XML_ERR_CHARREF_IN_EPILOG", + (const XML_Char *)"XML_ERR_CHARREF_IN_DTD", + (const XML_Char *)"XML_ERR_ENTITYREF_AT_EOF", + (const XML_Char *)"XML_ERR_ENTITYREF_IN_PROLOG", + (const XML_Char *)"XML_ERR_ENTITYREF_IN_EPILOG", + (const XML_Char *)"XML_ERR_ENTITYREF_IN_DTD", + (const XML_Char *)"PEReference at end of document", + (const XML_Char *)"PEReference in prolog", + (const XML_Char *)"PEReference in epilog", + (const XML_Char *)"PEReference: forbidden within markup decl in internal subset", + (const XML_Char *)"XML_ERR_ENTITYREF_NO_NAME", + (const XML_Char *)"EntityRef: expecting ';'", + (const XML_Char *)"PEReference: no name", + (const XML_Char *)"PEReference: expecting ';'", + (const XML_Char *)"Undeclared entity error", + (const XML_Char *)"Undeclared entity warning", + (const XML_Char *)"Unparsed Entity", + (const XML_Char *)"XML_ERR_ENTITY_IS_EXTERNAL", + (const XML_Char *)"XML_ERR_ENTITY_IS_PARAMETER", + (const XML_Char *)"Unknown encoding", + (const XML_Char *)"Unsupported encoding", + (const XML_Char *)"String not started expecting ' or \"", + (const XML_Char *)"String not closed expecting \" or '", + (const XML_Char *)"Namespace declaration error", + (const XML_Char *)"EntityValue: \" or ' expected", + (const XML_Char *)"EntityValue: \" or ' expected", + (const XML_Char *)"< in attribute", + (const XML_Char *)"Attribute not started", + (const XML_Char *)"Attribute not finished", + (const XML_Char *)"Attribute without value", + (const XML_Char *)"Attribute redefined", + (const XML_Char *)"SystemLiteral \" or ' expected", + (const XML_Char *)"SystemLiteral \" or ' expected", + /* (const XML_Char *)"XML_ERR_COMMENT_NOT_STARTED", <= eliminated on purpose */ + (const XML_Char *)"Comment not finished", + (const XML_Char *)"Processing Instruction not started", + (const XML_Char *)"Processing Instruction not finished", + (const XML_Char *)"NOTATION: Name expected here", + (const XML_Char *)"'>' required to close NOTATION declaration", + (const XML_Char *)"'(' required to start ATTLIST enumeration", + (const XML_Char *)"'(' required to start ATTLIST enumeration", + (const XML_Char *)"MixedContentDecl : '|' or ')*' expected", + (const XML_Char *)"XML_ERR_MIXED_NOT_FINISHED", + (const XML_Char *)"ELEMENT in DTD not started", + (const XML_Char *)"ELEMENT in DTD not finished", + (const XML_Char *)"XML declaration not started", + (const XML_Char *)"XML declaration not finished", + (const XML_Char *)"XML_ERR_CONDSEC_NOT_STARTED", + (const XML_Char *)"XML conditional section not closed", + (const XML_Char *)"Content error in the external subset", + (const XML_Char *)"DOCTYPE not finished", + (const XML_Char *)"Sequence ']]>' not allowed in content", + (const XML_Char *)"CDATA not finished", + (const XML_Char *)"Reserved XML Name", + (const XML_Char *)"Space required", + (const XML_Char *)"XML_ERR_SEPARATOR_REQUIRED", + (const XML_Char *)"NmToken expected in ATTLIST enumeration", + (const XML_Char *)"XML_ERR_NAME_REQUIRED", + (const XML_Char *)"MixedContentDecl : '#PCDATA' expected", + (const XML_Char *)"SYSTEM or PUBLIC, the URI is missing", + (const XML_Char *)"PUBLIC, the Public Identifier is missing", + (const XML_Char *)"< required", + (const XML_Char *)"> required", + (const XML_Char *)"</ required", + (const XML_Char *)"= required", + (const XML_Char *)"Mismatched tag", + (const XML_Char *)"Tag not finished", + (const XML_Char *)"standalone accepts only 'yes' or 'no'", + (const XML_Char *)"Invalid XML encoding name", + (const XML_Char *)"Comment must not contain '--' (double-hyphen)", + (const XML_Char *)"Invalid encoding", + (const XML_Char *)"external parsed entities cannot be standalone", + (const XML_Char *)"XML conditional section '[' expected", + (const XML_Char *)"Entity value required", + (const XML_Char *)"chunk is not well balanced", + (const XML_Char *)"extra content at the end of well balanced chunk", + (const XML_Char *)"XML_ERR_ENTITY_CHAR_ERROR", + (const XML_Char *)"PEReferences forbidden in internal subset", + (const XML_Char *)"Detected an entity reference loop", + (const XML_Char *)"XML_ERR_ENTITY_BOUNDARY", + (const XML_Char *)"Invalid URI", + (const XML_Char *)"Fragment not allowed", + (const XML_Char *)"XML_WAR_CATALOG_PI", + (const XML_Char *)"XML_ERR_NO_DTD", + (const XML_Char *)"conditional section INCLUDE or IGNORE keyword expected", /* 95 */ + (const XML_Char *)"Version in XML Declaration missing", /* 96 */ + (const XML_Char *)"XML_WAR_UNKNOWN_VERSION", /* 97 */ + (const XML_Char *)"XML_WAR_LANG_VALUE", /* 98 */ + (const XML_Char *)"XML_WAR_NS_URI", /* 99 */ + (const XML_Char *)"XML_WAR_NS_URI_RELATIVE", /* 100 */ + (const XML_Char *)"Missing encoding in text declaration" /* 101 */ }; PHPAPI const XML_Char * diff --git a/ext/xml/tests/bug65236.phpt b/ext/xml/tests/bug65236.phpt new file mode 100644 index 000000000..67b26d663 --- /dev/null +++ b/ext/xml/tests/bug65236.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #65236 (heap corruption in xml parser) +--SKIPIF-- +<?php +require_once("skipif.inc"); +?> +--FILE-- +<?php +xml_parse_into_struct(xml_parser_create_ns(), str_repeat("<blah>", 1000), $a); + +echo "Done\n"; +?> +--EXPECTF-- +Warning: xml_parse_into_struct(): Maximum depth exceeded - Results truncated in %s on line %d +Done diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 2fea4f8ab..1ef01c886 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -274,10 +274,10 @@ zend_module_entry xml_module_entry = { * the encoding is currently done internally by expat/xmltok. */ xml_encoding xml_encodings[] = { - { "ISO-8859-1", xml_decode_iso_8859_1, xml_encode_iso_8859_1 }, - { "US-ASCII", xml_decode_us_ascii, xml_encode_us_ascii }, - { "UTF-8", NULL, NULL }, - { NULL, NULL, NULL } + { (XML_Char *)"ISO-8859-1", xml_decode_iso_8859_1, xml_encode_iso_8859_1 }, + { (XML_Char *)"US-ASCII", xml_decode_us_ascii, xml_encode_us_ascii }, + { (XML_Char *)"UTF-8", NULL, NULL }, + { (XML_Char *)NULL, NULL, NULL } }; static XML_Memory_Handling_Suite php_xml_mem_hdlrs; @@ -428,7 +428,7 @@ static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) } if (parser->ltags) { int inx; - for (inx = 0; inx < parser->level; inx++) + for (inx = 0; ((inx < parser->level) && (inx < XML_MAXLEVEL)); inx++) efree(parser->ltags[ inx ]); efree(parser->ltags); } @@ -805,45 +805,50 @@ void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Ch } if (parser->data) { - zval *tag, *atr; - int atcnt = 0; + if (parser->level <= XML_MAXLEVEL) { + zval *tag, *atr; + int atcnt = 0; - MAKE_STD_ZVAL(tag); - MAKE_STD_ZVAL(atr); + MAKE_STD_ZVAL(tag); + MAKE_STD_ZVAL(atr); - array_init(tag); - array_init(atr); + array_init(tag); + array_init(atr); - _xml_add_to_info(parser,((char *) tag_name) + parser->toffset); + _xml_add_to_info(parser,((char *) tag_name) + parser->toffset); - add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */ - add_assoc_string(tag,"type","open",1); - add_assoc_long(tag,"level",parser->level); + add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */ + add_assoc_string(tag,"type","open",1); + add_assoc_long(tag,"level",parser->level); - parser->ltags[parser->level-1] = estrdup(tag_name); - parser->lastwasopen = 1; + parser->ltags[parser->level-1] = estrdup(tag_name); + parser->lastwasopen = 1; - attributes = (const XML_Char **) attrs; + attributes = (const XML_Char **) attrs; - while (attributes && *attributes) { - att = _xml_decode_tag(parser, attributes[0]); - val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, parser->target_encoding); - - add_assoc_stringl(atr,att,val,val_len,0); + while (attributes && *attributes) { + att = _xml_decode_tag(parser, attributes[0]); + val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, parser->target_encoding); - atcnt++; - attributes += 2; + add_assoc_stringl(atr,att,val,val_len,0); - efree(att); - } + atcnt++; + attributes += 2; - if (atcnt) { - zend_hash_add(Z_ARRVAL_P(tag),"attributes",sizeof("attributes"),&atr,sizeof(zval*),NULL); - } else { - zval_ptr_dtor(&atr); - } + efree(att); + } + + if (atcnt) { + zend_hash_add(Z_ARRVAL_P(tag),"attributes",sizeof("attributes"),&atr,sizeof(zval*),NULL); + } else { + zval_ptr_dtor(&atr); + } - zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),(void *) &parser->ctag); + zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),(void *) &parser->ctag); + } else if (parser->level == (XML_MAXLEVEL + 1)) { + TSRMLS_FETCH(); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Maximum depth exceeded - Results truncated"); + } } efree(tag_name); @@ -895,7 +900,7 @@ void _xml_endElementHandler(void *userData, const XML_Char *name) efree(tag_name); - if (parser->ltags) { + if ((parser->ltags) && (parser->level <= XML_MAXLEVEL)) { efree(parser->ltags[parser->level-1]); } @@ -979,18 +984,23 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len) } } - MAKE_STD_ZVAL(tag); - - array_init(tag); - - _xml_add_to_info(parser,parser->ltags[parser->level-1] + parser->toffset); + if (parser->level <= XML_MAXLEVEL) { + MAKE_STD_ZVAL(tag); + + array_init(tag); - add_assoc_string(tag,"tag",parser->ltags[parser->level-1] + parser->toffset,1); - add_assoc_string(tag,"value",decoded_value,0); - add_assoc_string(tag,"type","cdata",1); - add_assoc_long(tag,"level",parser->level); + _xml_add_to_info(parser,parser->ltags[parser->level-1] + parser->toffset); - zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),NULL); + add_assoc_string(tag,"tag",parser->ltags[parser->level-1] + parser->toffset,1); + add_assoc_string(tag,"value",decoded_value,0); + add_assoc_string(tag,"type","cdata",1); + add_assoc_long(tag,"level",parser->level); + + zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),NULL); + } else if (parser->level == (XML_MAXLEVEL + 1)) { + TSRMLS_FETCH(); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Maximum depth exceeded - Results truncated"); + } } } else { efree(decoded_value); diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 314be4529..f4c264321 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -708,7 +708,7 @@ PHP_METHOD(xmlreader, moveToAttribute) /* }}} */ /* {{{ proto boolean XMLReader::moveToAttributeNo(int index) -Positions reader at attribute at spcecified index. +Positions reader at attribute at specified index. Returns TRUE on success and FALSE on failure */ PHP_METHOD(xmlreader, moveToAttributeNo) { @@ -805,7 +805,7 @@ PHP_METHOD(xmlreader, read) if (intern != NULL && intern->ptr != NULL) { retval = xmlTextReaderRead(intern->ptr); if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while reading"); RETURN_FALSE; } else { RETURN_BOOL(retval); @@ -847,7 +847,7 @@ PHP_METHOD(xmlreader, next) retval = xmlTextReaderNext(intern->ptr); } if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while reading"); RETURN_FALSE; } else { RETURN_BOOL(retval); @@ -1155,7 +1155,7 @@ PHP_METHOD(xmlreader, expand) node = xmlTextReaderExpand(intern->ptr); if (node == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while expanding "); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while expanding "); RETURN_FALSE; } else { nodec = xmlDocCopyNode(node, docp, 1); diff --git a/ext/xmlreader/tests/003.phpt b/ext/xmlreader/tests/003.phpt index 48aa4be0b..85353a824 100644 --- a/ext/xmlreader/tests/003.phpt +++ b/ext/xmlreader/tests/003.phpt @@ -5,7 +5,7 @@ XMLReader: libxml2 XML Reader, attributes test --FILE-- <?php /* $Id$ */ -$filename = dirname(__FILE__) . '/_002.xml'; +$filename = dirname(__FILE__) . '/_003.xml'; $xmlstring = '<?xml version="1.0" encoding="UTF-8"?> <books><book num="1" idx="2">book1</book></books>'; diff --git a/ext/xmlreader/tests/004.phpt b/ext/xmlreader/tests/004.phpt index d4f044e97..b2d7254fe 100644 --- a/ext/xmlreader/tests/004.phpt +++ b/ext/xmlreader/tests/004.phpt @@ -5,7 +5,7 @@ XMLReader: libxml2 XML Reader, attributes test --FILE-- <?php /* $Id$ */ -$filename = dirname(__FILE__) . '/_002.xml'; +$filename = dirname(__FILE__) . '/_004.xml'; $xmlstring = '<?xml version="1.0" encoding="UTF-8"?> <books><book num="1" idx="2">book1</book></books>'; diff --git a/ext/xmlreader/tests/007.phpt b/ext/xmlreader/tests/007.phpt index 842f25e5f..aacd059b6 100644 --- a/ext/xmlreader/tests/007.phpt +++ b/ext/xmlreader/tests/007.phpt @@ -8,7 +8,7 @@ XMLReader: libxml2 XML Reader, setRelaxNGSchema $xmlstring = '<TEI.2>hello</TEI.2>'; $relaxngfile = dirname(__FILE__) . '/relaxNG.rng'; -$file = dirname(__FILE__) . '/__007.xml'; +$file = dirname(__FILE__) . '/_007.xml'; file_put_contents($file, $xmlstring); $reader = new XMLReader(); diff --git a/ext/xmlreader/tests/008.phpt b/ext/xmlreader/tests/008.phpt index e3af00e4f..2dbb5e7c8 100644 --- a/ext/xmlreader/tests/008.phpt +++ b/ext/xmlreader/tests/008.phpt @@ -23,7 +23,7 @@ $xmlstring = '<?xml version="1.0" encoding="UTF-8" standalone="no"?> </LIST>'; $dtdfile = rawurlencode(dirname(__FILE__)) . '/dtdexample.dtd'; -$file = dirname(__FILE__) . '/__008.xml'; +$file = dirname(__FILE__) . '/_008.xml'; file_put_contents($file, $xmlstring); diff --git a/ext/xmlrpc/libxmlrpc/simplestring.c b/ext/xmlrpc/libxmlrpc/simplestring.c index 7211d2cd9..a084d0e64 100644 --- a/ext/xmlrpc/libxmlrpc/simplestring.c +++ b/ext/xmlrpc/libxmlrpc/simplestring.c @@ -66,7 +66,7 @@ static const char rcsid[] = "#(@) $Id$"; * * simplestring is, as the name implies, a simple API for dealing with C strings. * Why would I write yet another string API? Because I couldn't find any that were - * a) free / GPL, b) simple/lightweight, c) fast, not doing unneccesary strlens all + * a) free / GPL, b) simple/lightweight, c) fast, not doing unnecessary strlens all * over the place. So. It is simple, and it seems to work, and it is pretty fast. * * Oh, and it is also binary safe, ie it can handle strings with embedded NULLs, diff --git a/ext/xmlrpc/libxmlrpc/xml_to_soap.c b/ext/xmlrpc/libxmlrpc/xml_to_soap.c index 664e8b77b..ac103e061 100644 --- a/ext/xmlrpc/libxmlrpc/xml_to_soap.c +++ b/ext/xmlrpc/libxmlrpc/xml_to_soap.c @@ -279,7 +279,7 @@ XMLRPC_VALUE xml_element_to_SOAP_REQUEST_worker(XMLRPC_REQUEST request, else if (!strcmp(attr_iter->key, TOKEN_MUSTUNDERSTAND)) { b_must_understand = strchr(attr_iter->val, '1') ? 1 : 0; } - /* actor, used in conjuction with must understand. */ + /* actor, used in conjunction with must understand. */ else if (!strcmp(attr_iter->key, TOKEN_ACTOR)) { actor = attr_iter->val; } diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c index ec2321b34..ce70c2afd 100644 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.c +++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c @@ -897,7 +897,7 @@ const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len, (len > 0) ? simplestring_addn(&value->id, id, len) : simplestring_add(&value->id, id); - /* upper or lower case string in place if required. could be a seperate func. */ + /* upper or lower case string in place if required. could be a separate func. */ if(id_case == xmlrpc_case_lower || id_case == xmlrpc_case_upper) { int i; for(i = 0; i < value->id.len; i++) { @@ -1609,7 +1609,7 @@ XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value) { * XMLRPC_CopyValue () * NOTES * Use this when function when you need to modify the contents of - * the copied value seperately from the original. + * the copied value separately from the original. * * this function is recursive, thus the value and all of its children * (if any) will be duplicated. diff --git a/ext/xmlrpc/tests/003.phpt b/ext/xmlrpc/tests/003.phpt new file mode 100644 index 000000000..3d6796dba --- /dev/null +++ b/ext/xmlrpc/tests/003.phpt @@ -0,0 +1,109 @@ +--TEST-- +xmlrpc_encode() Simple test encode array +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> +--FILE-- +<?php + +$params = array( + "one" => "red", + "two" => "blue", + "three" => "green" +); + +$response = xmlrpc_encode($params); +echo $response; + +$params = array( + "red", + "blue", + "green" +); + +$response = xmlrpc_encode($params); +echo $response; + +$params = array( + 0 => "red", + 1 => "blue", + 3 => "green" +); + +$response = xmlrpc_encode($params); +echo $response; + +--EXPECT-- +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <struct> + <member> + <name>one</name> + <value> + <string>red</string> + </value> + </member> + <member> + <name>two</name> + <value> + <string>blue</string> + </value> + </member> + <member> + <name>three</name> + <value> + <string>green</string> + </value> + </member> + </struct> + </value> +</param> +</params> +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <array> + <data> + <value> + <string>red</string> + </value> + <value> + <string>blue</string> + </value> + <value> + <string>green</string> + </value> + </data> + </array> + </value> +</param> +</params> +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <struct> + <member> + <name>0</name> + <value> + <string>red</string> + </value> + </member> + <member> + <name>1</name> + <value> + <string>blue</string> + </value> + </member> + <member> + <name>3</name> + <value> + <string>green</string> + </value> + </member> + </struct> + </value> +</param> +</params>
\ No newline at end of file diff --git a/ext/xmlrpc/tests/004.phpt b/ext/xmlrpc/tests/004.phpt new file mode 100644 index 000000000..04f3ef315 --- /dev/null +++ b/ext/xmlrpc/tests/004.phpt @@ -0,0 +1,19 @@ +--TEST-- +xmlrpc_encode() Simple test encode int +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> +--FILE-- +<?php + +$response = xmlrpc_encode(1); +echo $response; + +--EXPECT-- +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <int>1</int> + </value> +</param> +</params>
\ No newline at end of file diff --git a/ext/xmlrpc/tests/005.phpt b/ext/xmlrpc/tests/005.phpt new file mode 100644 index 000000000..613dfde24 --- /dev/null +++ b/ext/xmlrpc/tests/005.phpt @@ -0,0 +1,47 @@ +--TEST-- +xmlrpc_encode() Simple test encode type double and String + +--CREDITS-- +Michel Araujo <araujo_michel@yahoo.com.br> +#PHPSP 2013-08-22 + +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> + +--FILE-- +<?php + +$response = xmlrpc_encode(3.24234); +echo $response; + +$response = xmlrpc_encode(-3.24234); +echo $response; + +$response = xmlrpc_encode('Is string'); +echo $response; + +--EXPECT-- +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <double>3.24234</double> + </value> +</param> +</params> +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <double>-3.24234</double> + </value> +</param> +</params> +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <string>Is string</string> + </value> +</param> +</params>
\ No newline at end of file diff --git a/ext/xmlrpc/tests/006.phpt b/ext/xmlrpc/tests/006.phpt new file mode 100644 index 000000000..f33932d5a --- /dev/null +++ b/ext/xmlrpc/tests/006.phpt @@ -0,0 +1,29 @@ +--TEST-- +xmlrpc_decode() Simple test decode type string + +--CREDITS-- +Michel Araujo <araujo_michel@yahoo.com.br> +#PHPSP 2013-08-22 + +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> + +--FILE-- +<?php + +$xml = <<<XML +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <string>Is string</string> + </value> +</param> +</params> +XML; + +$response = xmlrpc_decode($xml); +echo $response; + +--EXPECT-- +Is string
\ No newline at end of file diff --git a/ext/xmlrpc/tests/007.phpt b/ext/xmlrpc/tests/007.phpt new file mode 100644 index 000000000..84c15a7d8 --- /dev/null +++ b/ext/xmlrpc/tests/007.phpt @@ -0,0 +1,29 @@ +--TEST-- +xmlrpc_decode() Simple test decode type int + +--CREDITS-- +Michel Araujo <araujo_michel@yahoo.com.br> +#PHPSP 2013-08-22 + +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> + +--FILE-- +<?php + +$xml = <<<XML +<?xml version="1.0" encoding="utf-8"?> +<params> +<param> + <value> + <int>1</int> + </value> +</param> +</params> +XML; + +$response = xmlrpc_decode($xml); +echo $response; + +--EXPECT-- +1
\ No newline at end of file diff --git a/ext/xmlwriter/tests/bug41287.phpt b/ext/xmlwriter/tests/bug41287.phpt index 0612b21f1..72b6720f1 100644 --- a/ext/xmlwriter/tests/bug41287.phpt +++ b/ext/xmlwriter/tests/bug41287.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #41287 (Namespace functions don't allow xmlns defintion to be optional) +Bug #41287 (Namespace functions don't allow xmlns definition to be optional) --SKIPIF-- <?php if (!extension_loaded("xmlwriter")) die("skip"); diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index 1785519c1..af11104a2 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -476,7 +476,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet) static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC) /* {{{ */ { - xmlDocPtr newdocp; + xmlDocPtr newdocp = NULL; xmlDocPtr doc = NULL; xmlNodePtr node = NULL; xsltTransformContextPtr ctxt; diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c index 2f56881b0..5ce1c1070 100644 --- a/ext/zip/lib/zip_open.c +++ b/ext/zip/lib/zip_open.c @@ -348,7 +348,7 @@ _zip_checkcons(FILE *fp, struct zip_cdir *cd, struct zip_error *error) /* _zip_check_torrentzip: - check wether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */ + check whether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */ static void _zip_check_torrentzip(struct zip *za) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 0c033d4e4..d7bd5f49e 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1654,7 +1654,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* char *path = NULL; char *remove_path = NULL; char *add_path = NULL; - int pattern_len, add_path_len, remove_path_len, path_len = 0; + int pattern_len, add_path_len = 0, remove_path_len = 0, path_len = 0; long remove_all_path = 0; long flags = 0; zval *options = NULL; diff --git a/ext/zip/tests/bug64342_0.phpt b/ext/zip/tests/bug64342_0.phpt index 066d3e6fc..ea7afa8e0 100644 --- a/ext/zip/tests/bug64342_0.phpt +++ b/ext/zip/tests/bug64342_0.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #64342 ZipArchive::addFile() has to check file existance (variation 1) +Bug #64342 ZipArchive::addFile() has to check file existence (variation 1) --SKIPIF-- <?php if(!extension_loaded('zip')) die('skip'); diff --git a/ext/zip/tests/bug64342_1.phpt b/ext/zip/tests/bug64342_1.phpt index 2b1357d12..06b0b92ca 100644 --- a/ext/zip/tests/bug64342_1.phpt +++ b/ext/zip/tests/bug64342_1.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #64342 ZipArchive::addFile() has to check file existance (variation 2) +Bug #64342 ZipArchive::addFile() has to check file existence (variation 2) --SKIPIF-- <?php /* $Id$ */ diff --git a/ext/zlib/tests/bug61139.phpt b/ext/zlib/tests/bug61139.phpt index eaca00369..71961a64d 100644 --- a/ext/zlib/tests/bug61139.phpt +++ b/ext/zlib/tests/bug61139.phpt @@ -10,5 +10,9 @@ if (!extension_loaded('zlib')) { <?php gzopen('someFile', 'c'); +--CLEAN-- +<?php + unlink('someFile'); +?> --EXPECTF-- Warning: gzopen(): gzopen failed in %s on line %d diff --git a/ext/zlib/tests/bug65391.phpt b/ext/zlib/tests/bug65391.phpt new file mode 100644 index 000000000..3ba535081 --- /dev/null +++ b/ext/zlib/tests/bug65391.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #65391 (Unable to send vary header user-agent when ob_start('ob_gzhandler') is called) +--SKIPIF-- +<?php +extension_loaded("zlib") or die("skip need zlib"); +?> +--GET-- +dummy=1 +--FILE-- +<?php +header("Vary: Cookie"); +ob_start("ob_gzhandler"); + +// run-tests cannot test for a multiple Vary header +ob_flush(); +print_r(headers_list()); + +?> +Done +--EXPECTF-- +Array +( + [0] => X-Powered-By: PHP/%s + [1] => Vary: Cookie + [2] => Vary: Accept-Encoding +) +Done + diff --git a/ext/zlib/tests/gzfile_variation1.phpt b/ext/zlib/tests/gzfile_variation1.phpt index 767abb7e3..131170b4b 100644 --- a/ext/zlib/tests/gzfile_variation1.phpt +++ b/ext/zlib/tests/gzfile_variation1.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 1 with array values. +Test function gzfile() by substituting argument 1 with array values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation10.phpt b/ext/zlib/tests/gzfile_variation10.phpt index 2a6d8915d..20de8cb53 100644 --- a/ext/zlib/tests/gzfile_variation10.phpt +++ b/ext/zlib/tests/gzfile_variation10.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 2 with emptyUnsetUndefNull values. +Test function gzfile() by substituting argument 2 with emptyUnsetUndefNull values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation11.phpt b/ext/zlib/tests/gzfile_variation11.phpt index 02faa4501..a3585e542 100644 --- a/ext/zlib/tests/gzfile_variation11.phpt +++ b/ext/zlib/tests/gzfile_variation11.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 2 with float values. +Test function gzfile() by substituting argument 2 with float values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation12.phpt b/ext/zlib/tests/gzfile_variation12.phpt index a8efc7616..be28f0168 100644 --- a/ext/zlib/tests/gzfile_variation12.phpt +++ b/ext/zlib/tests/gzfile_variation12.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 2 with int values. +Test function gzfile() by substituting argument 2 with int values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation13.phpt b/ext/zlib/tests/gzfile_variation13.phpt index 8014d7d9d..4198c474d 100644 --- a/ext/zlib/tests/gzfile_variation13.phpt +++ b/ext/zlib/tests/gzfile_variation13.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 2 with object values. +Test function gzfile() by substituting argument 2 with object values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation14.phpt b/ext/zlib/tests/gzfile_variation14.phpt index 8eb183c1c..7462bea80 100644 --- a/ext/zlib/tests/gzfile_variation14.phpt +++ b/ext/zlib/tests/gzfile_variation14.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 2 with string values. +Test function gzfile() by substituting argument 2 with string values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation2.phpt b/ext/zlib/tests/gzfile_variation2.phpt index 2f75c7f81..ba487435c 100644 --- a/ext/zlib/tests/gzfile_variation2.phpt +++ b/ext/zlib/tests/gzfile_variation2.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 1 with boolean values. +Test function gzfile() by substituting argument 1 with boolean values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation3.phpt b/ext/zlib/tests/gzfile_variation3.phpt index 8a6f2cec2..cf4520d41 100644 --- a/ext/zlib/tests/gzfile_variation3.phpt +++ b/ext/zlib/tests/gzfile_variation3.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 1 with emptyUnsetUndefNull values. +Test function gzfile() by substituting argument 1 with emptyUnsetUndefNull values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation4.phpt b/ext/zlib/tests/gzfile_variation4.phpt index b3c8ac483..331023156 100644 --- a/ext/zlib/tests/gzfile_variation4.phpt +++ b/ext/zlib/tests/gzfile_variation4.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 1 with float values. +Test function gzfile() by substituting argument 1 with float values. --SKIPIF-- <?php if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation5.phpt b/ext/zlib/tests/gzfile_variation5.phpt index 5e210b653..6a874a578 100644 --- a/ext/zlib/tests/gzfile_variation5.phpt +++ b/ext/zlib/tests/gzfile_variation5.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 1 with int values. +Test function gzfile() by substituting argument 1 with int values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation6.phpt b/ext/zlib/tests/gzfile_variation6.phpt index 1ce1be659..64168180f 100644 --- a/ext/zlib/tests/gzfile_variation6.phpt +++ b/ext/zlib/tests/gzfile_variation6.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 1 with object values. +Test function gzfile() by substituting argument 1 with object values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation7.phpt b/ext/zlib/tests/gzfile_variation7.phpt index b441dd670..c9dd29826 100644 --- a/ext/zlib/tests/gzfile_variation7.phpt +++ b/ext/zlib/tests/gzfile_variation7.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 1 with string values. +Test function gzfile() by substituting argument 1 with string values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation8.phpt b/ext/zlib/tests/gzfile_variation8.phpt index 32d969326..50d042218 100644 --- a/ext/zlib/tests/gzfile_variation8.phpt +++ b/ext/zlib/tests/gzfile_variation8.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 2 with array values. +Test function gzfile() by substituting argument 2 with array values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/gzfile_variation9.phpt b/ext/zlib/tests/gzfile_variation9.phpt index c2c24ae26..3675dcbef 100644 --- a/ext/zlib/tests/gzfile_variation9.phpt +++ b/ext/zlib/tests/gzfile_variation9.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting agument 2 with boolean values. +Test function gzfile() by substituting argument 2 with boolean values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation1.phpt b/ext/zlib/tests/readgzfile_variation1.phpt index e31824ce1..5a5ec4f6e 100644 --- a/ext/zlib/tests/readgzfile_variation1.phpt +++ b/ext/zlib/tests/readgzfile_variation1.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 1 with array values. +Test function readgzfile() by substituting argument 1 with array values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation10.phpt b/ext/zlib/tests/readgzfile_variation10.phpt index 29249a1f2..bc6cc5b45 100644 --- a/ext/zlib/tests/readgzfile_variation10.phpt +++ b/ext/zlib/tests/readgzfile_variation10.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 2 with emptyUnsetUndefNull values. +Test function readgzfile() by substituting argument 2 with emptyUnsetUndefNull values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation11.phpt b/ext/zlib/tests/readgzfile_variation11.phpt index 4023211ff..01dc78721 100644 --- a/ext/zlib/tests/readgzfile_variation11.phpt +++ b/ext/zlib/tests/readgzfile_variation11.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 2 with float values. +Test function readgzfile() by substituting argument 2 with float values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation12.phpt b/ext/zlib/tests/readgzfile_variation12.phpt index 8c291a4f4..06486acdd 100644 --- a/ext/zlib/tests/readgzfile_variation12.phpt +++ b/ext/zlib/tests/readgzfile_variation12.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 2 with int values. +Test function readgzfile() by substituting argument 2 with int values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation13.phpt b/ext/zlib/tests/readgzfile_variation13.phpt index 117860eb4..db1bd892a 100644 --- a/ext/zlib/tests/readgzfile_variation13.phpt +++ b/ext/zlib/tests/readgzfile_variation13.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 2 with object values. +Test function readgzfile() by substituting argument 2 with object values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation14.phpt b/ext/zlib/tests/readgzfile_variation14.phpt index ee0d6d6d4..90081a946 100644 --- a/ext/zlib/tests/readgzfile_variation14.phpt +++ b/ext/zlib/tests/readgzfile_variation14.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 2 with string values. +Test function readgzfile() by substituting argument 2 with string values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation2.phpt b/ext/zlib/tests/readgzfile_variation2.phpt index 367cc401b..53a9f3e31 100644 --- a/ext/zlib/tests/readgzfile_variation2.phpt +++ b/ext/zlib/tests/readgzfile_variation2.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 1 with boolean values. +Test function readgzfile() by substituting argument 1 with boolean values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation3.phpt b/ext/zlib/tests/readgzfile_variation3.phpt index 6645d67b7..8afb16946 100644 --- a/ext/zlib/tests/readgzfile_variation3.phpt +++ b/ext/zlib/tests/readgzfile_variation3.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 1 with emptyUnsetUndefNull values. +Test function readgzfile() by substituting argument 1 with emptyUnsetUndefNull values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation4.phpt b/ext/zlib/tests/readgzfile_variation4.phpt index ece84a990..00211f7df 100644 --- a/ext/zlib/tests/readgzfile_variation4.phpt +++ b/ext/zlib/tests/readgzfile_variation4.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 1 with float values. +Test function readgzfile() by substituting argument 1 with float values. --SKIPIF-- <?php if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation5.phpt b/ext/zlib/tests/readgzfile_variation5.phpt index 460e18893..2aa83fde3 100644 --- a/ext/zlib/tests/readgzfile_variation5.phpt +++ b/ext/zlib/tests/readgzfile_variation5.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 1 with int values. +Test function readgzfile() by substituting argument 1 with int values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation6.phpt b/ext/zlib/tests/readgzfile_variation6.phpt index 69a4dc190..702f91850 100644 --- a/ext/zlib/tests/readgzfile_variation6.phpt +++ b/ext/zlib/tests/readgzfile_variation6.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 1 with object values. +Test function readgzfile() by substituting argument 1 with object values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation7.phpt b/ext/zlib/tests/readgzfile_variation7.phpt index 20162b5cb..f4abdac9b 100644 --- a/ext/zlib/tests/readgzfile_variation7.phpt +++ b/ext/zlib/tests/readgzfile_variation7.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 1 with string values. +Test function readgzfile() by substituting argument 1 with string values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation8.phpt b/ext/zlib/tests/readgzfile_variation8.phpt index 2e155288f..291b69efc 100644 --- a/ext/zlib/tests/readgzfile_variation8.phpt +++ b/ext/zlib/tests/readgzfile_variation8.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 2 with array values. +Test function readgzfile() by substituting argument 2 with array values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/tests/readgzfile_variation9.phpt b/ext/zlib/tests/readgzfile_variation9.phpt index 5cdb5b5da..d90058f8d 100644 --- a/ext/zlib/tests/readgzfile_variation9.phpt +++ b/ext/zlib/tests/readgzfile_variation9.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function readgzfile() by substituting agument 2 with boolean values. +Test function readgzfile() by substituting argument 2 with boolean values. --SKIPIF-- <?php if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 1a202e344..1114bc8a6 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -190,7 +190,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o if ((output_context->op & PHP_OUTPUT_HANDLER_START) && (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL)) ) { - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); } return FAILURE; } @@ -220,7 +220,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o deflateEnd(&ctx->Z); return FAILURE; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC); } } @@ -478,7 +478,7 @@ static PHP_FUNCTION(ob_gzhandler) sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC); break; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); } if (!ZLIBG(ob_gzhandler)) { |