summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-09-19 10:38:31 +0000
committerDmitry Stogov <dmitry@php.net>2006-09-19 10:38:31 +0000
commit128548a5c064b8f817c2fc4988b3da383731e65e (patch)
tree9fdd4f8919a19a6582ef03d417dffbbb2ee003d0 /ext
parent591477b1435eb7dc6e25fd735de712e264e3d658 (diff)
downloadphp-git-128548a5c064b8f817c2fc4988b3da383731e65e.tar.gz
Disabled autoconversion of hash keys (from string to unicode) for PHP arrays
Diffstat (limited to 'ext')
-rw-r--r--ext/date/php_date.c152
-rw-r--r--ext/dom/node.c4
-rw-r--r--ext/filter/logical_filters.c4
-rw-r--r--ext/session/session.c34
-rw-r--r--ext/simplexml/simplexml.c20
-rw-r--r--ext/soap/php_encoding.c2
-rw-r--r--ext/soap/php_packet_soap.c33
-rw-r--r--ext/soap/soap.c78
-rw-r--r--ext/sqlite/sqlite.c6
-rw-r--r--ext/standard/basic_functions.c30
-rw-r--r--ext/standard/datetime.c18
-rw-r--r--ext/standard/dns.c84
-rw-r--r--ext/standard/file.c26
-rw-r--r--ext/standard/filestat.c26
-rw-r--r--ext/standard/http_fopen_wrapper.c2
-rw-r--r--ext/standard/image.c10
-rw-r--r--ext/standard/info.c8
-rw-r--r--ext/standard/iptc.c4
-rw-r--r--ext/standard/microtime.c10
-rw-r--r--ext/standard/proc_open.c18
-rw-r--r--ext/standard/scanf.c6
-rw-r--r--ext/standard/streamsfuncs.c42
-rw-r--r--ext/standard/string.c90
-rw-r--r--ext/standard/url.c16
-rw-r--r--ext/zlib/zlib.c2
25 files changed, 385 insertions, 340 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 3ecb30fbae..62f4b19bca 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1511,15 +1511,15 @@ PHP_FUNCTION(localtime)
array_init(return_value);
if (associative) {
- add_assoc_long(return_value, "tm_sec", ts->s);
- add_assoc_long(return_value, "tm_min", ts->i);
- add_assoc_long(return_value, "tm_hour", ts->h);
- add_assoc_long(return_value, "tm_mday", ts->d);
- add_assoc_long(return_value, "tm_mon", ts->m - 1);
- add_assoc_long(return_value, "tm_year", ts->y - 1900);
- add_assoc_long(return_value, "tm_wday", timelib_day_of_week(ts->y, ts->m, ts->d));
- add_assoc_long(return_value, "tm_yday", timelib_day_of_year(ts->y, ts->m, ts->d));
- add_assoc_long(return_value, "tm_isdst", ts->dst);
+ add_ascii_assoc_long(return_value, "tm_sec", ts->s);
+ add_ascii_assoc_long(return_value, "tm_min", ts->i);
+ add_ascii_assoc_long(return_value, "tm_hour", ts->h);
+ add_ascii_assoc_long(return_value, "tm_mday", ts->d);
+ add_ascii_assoc_long(return_value, "tm_mon", ts->m - 1);
+ add_ascii_assoc_long(return_value, "tm_year", ts->y - 1900);
+ add_ascii_assoc_long(return_value, "tm_wday", timelib_day_of_week(ts->y, ts->m, ts->d));
+ add_ascii_assoc_long(return_value, "tm_yday", timelib_day_of_year(ts->y, ts->m, ts->d));
+ add_ascii_assoc_long(return_value, "tm_isdst", ts->dst);
} else {
add_next_index_long(return_value, ts->s);
add_next_index_long(return_value, ts->i);
@@ -1556,16 +1556,16 @@ PHP_FUNCTION(getdate)
array_init(return_value);
- add_assoc_long(return_value, "seconds", ts->s);
- add_assoc_long(return_value, "minutes", ts->i);
- add_assoc_long(return_value, "hours", ts->h);
- add_assoc_long(return_value, "mday", ts->d);
- add_assoc_long(return_value, "wday", timelib_day_of_week(ts->y, ts->m, ts->d));
- add_assoc_long(return_value, "mon", ts->m);
- add_assoc_long(return_value, "year", ts->y);
- add_assoc_long(return_value, "yday", timelib_day_of_year(ts->y, ts->m, ts->d));
- add_assoc_string(return_value, "weekday", php_date_full_day_name(ts->y, ts->m, ts->d), 1);
- add_assoc_string(return_value, "month", mon_full_names[ts->m - 1], 1);
+ add_ascii_assoc_long(return_value, "seconds", ts->s);
+ add_ascii_assoc_long(return_value, "minutes", ts->i);
+ add_ascii_assoc_long(return_value, "hours", ts->h);
+ add_ascii_assoc_long(return_value, "mday", ts->d);
+ add_ascii_assoc_long(return_value, "wday", timelib_day_of_week(ts->y, ts->m, ts->d));
+ add_ascii_assoc_long(return_value, "mon", ts->m);
+ add_ascii_assoc_long(return_value, "year", ts->y);
+ add_ascii_assoc_long(return_value, "yday", timelib_day_of_year(ts->y, ts->m, ts->d));
+ add_ascii_assoc_string(return_value, "weekday", php_date_full_day_name(ts->y, ts->m, ts->d), 1);
+ add_ascii_assoc_string(return_value, "month", mon_full_names[ts->m - 1], 1);
add_index_long(return_value, 0, timestamp);
timelib_time_dtor(ts);
@@ -1831,9 +1831,9 @@ PHP_FUNCTION(date_parse)
array_init(return_value);
#define PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(name, elem) \
if (parsed_time->elem == -1) { \
- add_assoc_bool(return_value, #name, 0); \
+ add_ascii_assoc_bool(return_value, #name, 0); \
} else { \
- add_assoc_long(return_value, #name, parsed_time->elem); \
+ add_ascii_assoc_long(return_value, #name, parsed_time->elem); \
}
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(year, y);
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(month, m);
@@ -1843,49 +1843,49 @@ PHP_FUNCTION(date_parse)
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(second, s);
if (parsed_time->f == -1) {
- add_assoc_bool(return_value, "fraction", 0);
+ add_ascii_assoc_bool(return_value, "fraction", 0);
} else {
- add_assoc_double(return_value, "fraction", parsed_time->f);
+ add_ascii_assoc_double(return_value, "fraction", parsed_time->f);
}
- add_assoc_long(return_value, "warning_count", error->warning_count);
+ add_ascii_assoc_long(return_value, "warning_count", error->warning_count);
MAKE_STD_ZVAL(element);
array_init(element);
for (i = 0; i < error->warning_count; i++) {
add_index_string(element, error->warning_messages[i].position, error->warning_messages[i].message, 1);
}
- add_assoc_zval(return_value, "warnings", element);
+ add_ascii_assoc_zval(return_value, "warnings", element);
- add_assoc_long(return_value, "error_count", error->error_count);
+ add_ascii_assoc_long(return_value, "error_count", error->error_count);
MAKE_STD_ZVAL(element);
array_init(element);
for (i = 0; i < error->error_count; i++) {
add_index_string(element, error->error_messages[i].position, error->error_messages[i].message, 1);
}
- add_assoc_zval(return_value, "errors", element);
+ add_ascii_assoc_zval(return_value, "errors", element);
timelib_error_container_dtor(error);
- add_assoc_bool(return_value, "is_localtime", parsed_time->is_localtime);
+ add_ascii_assoc_bool(return_value, "is_localtime", parsed_time->is_localtime);
if (parsed_time->is_localtime) {
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone_type, zone_type);
switch (parsed_time->zone_type) {
case TIMELIB_ZONETYPE_OFFSET:
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone, z);
- add_assoc_bool(return_value, "is_dst", parsed_time->dst);
+ add_ascii_assoc_bool(return_value, "is_dst", parsed_time->dst);
break;
case TIMELIB_ZONETYPE_ID:
if (parsed_time->tz_abbr) {
- add_assoc_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1);
+ add_ascii_assoc_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1);
}
if (parsed_time->tz_info) {
- add_assoc_string(return_value, "tz_id", parsed_time->tz_info->name, 1);
+ add_ascii_assoc_string(return_value, "tz_id", parsed_time->tz_info->name, 1);
}
break;
case TIMELIB_ZONETYPE_ABBR:
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone, z);
- add_assoc_bool(return_value, "is_dst", parsed_time->dst);
- add_assoc_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1);
+ add_ascii_assoc_bool(return_value, "is_dst", parsed_time->dst);
+ add_ascii_assoc_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1);
break;
}
}
@@ -1894,18 +1894,18 @@ PHP_FUNCTION(date_parse)
array_init(element);
}
if (parsed_time->have_relative) {
- add_assoc_long(element, "year", parsed_time->relative.y);
- add_assoc_long(element, "month", parsed_time->relative.m);
- add_assoc_long(element, "day", parsed_time->relative.d);
- add_assoc_long(element, "hour", parsed_time->relative.h);
- add_assoc_long(element, "minute", parsed_time->relative.i);
- add_assoc_long(element, "second", parsed_time->relative.s);
+ add_ascii_assoc_long(element, "year", parsed_time->relative.y);
+ add_ascii_assoc_long(element, "month", parsed_time->relative.m);
+ add_ascii_assoc_long(element, "day", parsed_time->relative.d);
+ add_ascii_assoc_long(element, "hour", parsed_time->relative.h);
+ add_ascii_assoc_long(element, "minute", parsed_time->relative.i);
+ add_ascii_assoc_long(element, "second", parsed_time->relative.s);
}
if (parsed_time->have_weekday_relative) {
- add_assoc_long(element, "weekday", parsed_time->relative.weekday);
+ add_ascii_assoc_long(element, "weekday", parsed_time->relative.weekday);
}
if (parsed_time->have_relative || parsed_time->have_weekday_relative) {
- add_assoc_zval(return_value, "relative", element);
+ add_ascii_assoc_zval(return_value, "relative", element);
}
timelib_time_dtor(parsed_time);
}
@@ -2258,11 +2258,11 @@ PHP_FUNCTION(timezone_transitions_get)
for (i = 0; i < tzobj->tz->timecnt; ++i) {
MAKE_STD_ZVAL(element);
array_init(element);
- add_assoc_long(element, "ts", tzobj->tz->trans[i]);
- add_assoc_string(element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, tzobj->tz->trans[i], 0 TSRMLS_CC), 0);
- add_assoc_long(element, "offset", tzobj->tz->type[tzobj->tz->trans_idx[i]].offset);
- add_assoc_bool(element, "isdst", tzobj->tz->type[tzobj->tz->trans_idx[i]].isdst);
- add_assoc_string(element, "abbr", &tzobj->tz->timezone_abbr[tzobj->tz->type[tzobj->tz->trans_idx[i]].abbr_idx], 1);
+ add_ascii_assoc_long(element, "ts", tzobj->tz->trans[i]);
+ add_ascii_assoc_string(element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, tzobj->tz->trans[i], 0 TSRMLS_CC), 0);
+ add_ascii_assoc_long(element, "offset", tzobj->tz->type[tzobj->tz->trans_idx[i]].offset);
+ add_ascii_assoc_bool(element, "isdst", tzobj->tz->type[tzobj->tz->trans_idx[i]].isdst);
+ add_ascii_assoc_string(element, "abbr", &tzobj->tz->timezone_abbr[tzobj->tz->type[tzobj->tz->trans_idx[i]].abbr_idx], 1);
add_next_index_zval(return_value, element);
}
@@ -2303,18 +2303,18 @@ PHP_FUNCTION(timezone_abbreviations_list)
do {
MAKE_STD_ZVAL(element);
array_init(element);
- add_assoc_bool(element, "dst", entry->type);
- add_assoc_long(element, "offset", entry->gmtoffset);
+ add_ascii_assoc_bool(element, "dst", entry->type);
+ add_ascii_assoc_long(element, "offset", entry->gmtoffset);
if (entry->full_tz_name) {
- add_assoc_string(element, "timezone_id", entry->full_tz_name, 1);
+ add_ascii_assoc_string(element, "timezone_id", entry->full_tz_name, 1);
} else {
- add_assoc_null(element, "timezone_id");
+ add_ascii_assoc_null(element, "timezone_id");
}
if (zend_hash_find(HASH_OF(return_value), entry->name, strlen(entry->name) + 1, (void **) &abbr_array_pp) == FAILURE) {
MAKE_STD_ZVAL(abbr_array);
array_init(abbr_array);
- add_assoc_zval(return_value, entry->name, abbr_array);
+ add_ascii_assoc_zval(return_value, entry->name, abbr_array);
} else {
abbr_array = *abbr_array_pp;
}
@@ -2493,74 +2493,74 @@ PHP_FUNCTION(date_sun_info)
rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -35.0/60, 1, &ddummy, &ddummy, &rise, &set, &transit);
switch (rs) {
case -1: /* always below */
- add_assoc_bool(return_value, "sunrise", 0);
- add_assoc_bool(return_value, "sunset", 0);
+ add_ascii_assoc_bool(return_value, "sunrise", 0);
+ add_ascii_assoc_bool(return_value, "sunset", 0);
break;
case 1: /* always above */
- add_assoc_bool(return_value, "sunrise", 1);
- add_assoc_bool(return_value, "sunset", 1);
+ add_ascii_assoc_bool(return_value, "sunrise", 1);
+ add_ascii_assoc_bool(return_value, "sunset", 1);
break;
default:
t2->sse = rise;
- add_assoc_long(return_value, "sunrise", timelib_date_to_int(t2, &dummy));
+ add_ascii_assoc_long(return_value, "sunrise", timelib_date_to_int(t2, &dummy));
t2->sse = set;
- add_assoc_long(return_value, "sunset", timelib_date_to_int(t2, &dummy));
+ add_ascii_assoc_long(return_value, "sunset", timelib_date_to_int(t2, &dummy));
}
t2->sse = transit;
- add_assoc_long(return_value, "transit", timelib_date_to_int(t2, &dummy));
+ add_ascii_assoc_long(return_value, "transit", timelib_date_to_int(t2, &dummy));
/* Get civil twilight */
rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -6.0, 0, &ddummy, &ddummy, &rise, &set, &transit);
switch (rs) {
case -1: /* always below */
- add_assoc_bool(return_value, "civil_twilight_begin", 0);
- add_assoc_bool(return_value, "civil_twilight_end", 0);
+ add_ascii_assoc_bool(return_value, "civil_twilight_begin", 0);
+ add_ascii_assoc_bool(return_value, "civil_twilight_end", 0);
break;
case 1: /* always above */
- add_assoc_bool(return_value, "civil_twilight_begin", 1);
- add_assoc_bool(return_value, "civil_twilight_end", 1);
+ add_ascii_assoc_bool(return_value, "civil_twilight_begin", 1);
+ add_ascii_assoc_bool(return_value, "civil_twilight_end", 1);
break;
default:
t2->sse = rise;
- add_assoc_long(return_value, "civil_twilight_begin", timelib_date_to_int(t2, &dummy));
+ add_ascii_assoc_long(return_value, "civil_twilight_begin", timelib_date_to_int(t2, &dummy));
t2->sse = set;
- add_assoc_long(return_value, "civil_twilight_end", timelib_date_to_int(t2, &dummy));
+ add_ascii_assoc_long(return_value, "civil_twilight_end", timelib_date_to_int(t2, &dummy));
}
/* Get nautical twilight */
rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -12.0, 0, &ddummy, &ddummy, &rise, &set, &transit);
switch (rs) {
case -1: /* always below */
- add_assoc_bool(return_value, "nautical_twilight_begin", 0);
- add_assoc_bool(return_value, "nautical_twilight_end", 0);
+ add_ascii_assoc_bool(return_value, "nautical_twilight_begin", 0);
+ add_ascii_assoc_bool(return_value, "nautical_twilight_end", 0);
break;
case 1: /* always above */
- add_assoc_bool(return_value, "nautical_twilight_begin", 1);
- add_assoc_bool(return_value, "nautical_twilight_end", 1);
+ add_ascii_assoc_bool(return_value, "nautical_twilight_begin", 1);
+ add_ascii_assoc_bool(return_value, "nautical_twilight_end", 1);
break;
default:
t2->sse = rise;
- add_assoc_long(return_value, "nautical_twilight_begin", timelib_date_to_int(t2, &dummy));
+ add_ascii_assoc_long(return_value, "nautical_twilight_begin", timelib_date_to_int(t2, &dummy));
t2->sse = set;
- add_assoc_long(return_value, "nautical_twilight_end", timelib_date_to_int(t2, &dummy));
+ add_ascii_assoc_long(return_value, "nautical_twilight_end", timelib_date_to_int(t2, &dummy));
}
/* Get astronomical twilight */
rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -18.0, 0, &ddummy, &ddummy, &rise, &set, &transit);
switch (rs) {
case -1: /* always below */
- add_assoc_bool(return_value, "astronomical_twilight_begin", 0);
- add_assoc_bool(return_value, "astronomical_twilight_end", 0);
+ add_ascii_assoc_bool(return_value, "astronomical_twilight_begin", 0);
+ add_ascii_assoc_bool(return_value, "astronomical_twilight_end", 0);
break;
case 1: /* always above */
- add_assoc_bool(return_value, "astronomical_twilight_begin", 1);
- add_assoc_bool(return_value, "astronomical_twilight_end", 1);
+ add_ascii_assoc_bool(return_value, "astronomical_twilight_begin", 1);
+ add_ascii_assoc_bool(return_value, "astronomical_twilight_end", 1);
break;
default:
t2->sse = rise;
- add_assoc_long(return_value, "astronomical_twilight_begin", timelib_date_to_int(t2, &dummy));
+ add_ascii_assoc_long(return_value, "astronomical_twilight_begin", timelib_date_to_int(t2, &dummy));
t2->sse = set;
- add_assoc_long(return_value, "astronomical_twilight_end", timelib_date_to_int(t2, &dummy));
+ add_ascii_assoc_long(return_value, "astronomical_twilight_end", timelib_date_to_int(t2, &dummy));
}
timelib_time_dtor(t);
timelib_time_dtor(t2);
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 67ac970498..5bc3cf71f0 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -1747,7 +1747,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode)
char *xquery;
int xquery_len;
- if (zend_hash_find(ht, "query", sizeof("query"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "query", sizeof("query"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
zxquery = tmp;
/*
@@ -1768,7 +1768,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode)
ctxp = xmlXPathNewContext(docp);
ctxp->node = nodep;
- if (zend_hash_find(ht, "namespaces", sizeof("namespaces"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "namespaces", sizeof("namespaces"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_ARRAY) {
zval **tmpns;
char *nschar;
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index e3f85f95b2..760f980626 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -29,7 +29,7 @@
var_name = 0; \
var_name##_set = 0; \
if (option_array) { \
- if (zend_hash_find(HASH_OF(option_array), option_name, sizeof(option_name), (void **) &option_val) == SUCCESS) { \
+ if (zend_ascii_hash_find(HASH_OF(option_array), option_name, sizeof(option_name), (void **) &option_val) == SUCCESS) { \
convert_to_long(*option_val); \
var_name = Z_LVAL_PP(option_val); \
var_name##_set = 1; \
@@ -43,7 +43,7 @@
var_name##_set = 0; \
var_name##_len = 0; \
if (option_array) { \
- if (zend_hash_find(HASH_OF(option_array), option_name, sizeof(option_name), (void **) &option_val) == SUCCESS) { \
+ if (zend_ascii_hash_find(HASH_OF(option_array), option_name, sizeof(option_name), (void **) &option_val) == SUCCESS) { \
convert_to_string(*option_val); \
var_name = Z_STRVAL_PP(option_val); \
var_name##_set = 1; \
diff --git a/ext/session/session.c b/ext/session/session.c
index 396b9cb307..a6a7e90431 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -297,7 +297,7 @@ PHPAPI void php_add_session_var(char *name, size_t namelen TSRMLS_DC)
zval **sym_track = NULL;
IF_SESSION_VARS() {
- zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1,
+ zend_rt_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1,
(void *) &sym_track);
} else {
return;
@@ -321,7 +321,7 @@ PHPAPI int php_get_session_var(char *name, size_t namelen, zval ***state_var TSR
int ret = FAILURE;
IF_SESSION_VARS() {
- ret = zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name,
+ ret = zend_rt_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name,
namelen+1, (void **) state_var);
}
@@ -591,10 +591,10 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS)
gettimeofday(&tv, NULL);
- if (zend_hash_find(&EG(symbol_table), "_SERVER",
+ if (zend_ascii_hash_find(&EG(symbol_table), "_SERVER",
sizeof("_SERVER"), (void **) &array) == SUCCESS &&
Z_TYPE_PP(array) == IS_ARRAY &&
- zend_hash_find(Z_ARRVAL_PP(array), "REMOTE_ADDR",
+ zend_ascii_hash_find(Z_ARRVAL_PP(array), "REMOTE_ADDR",
sizeof("REMOTE_ADDR"), (void **) &token) == SUCCESS) {
remote_addr = Z_STRVAL_PP(token);
}
@@ -1027,7 +1027,7 @@ static void php_session_reset_id(TSRMLS_D)
}
/* if the SID constant exists, destroy it. */
- zend_hash_del(EG(zend_constants), "sid", sizeof("sid"));
+ zend_ascii_hash_del(EG(zend_constants), "sid", sizeof("sid"));
if (PS(define_sid)) {
smart_str var = {0};
@@ -1088,10 +1088,10 @@ PHPAPI void php_session_start(TSRMLS_D)
*/
if (!PS(id)) {
- if (PS(use_cookies) && zend_hash_find(&EG(symbol_table), "_COOKIE",
+ if (PS(use_cookies) && zend_ascii_hash_find(&EG(symbol_table), "_COOKIE",
sizeof("_COOKIE"), (void **) &data) == SUCCESS &&
Z_TYPE_PP(data) == IS_ARRAY &&
- zend_hash_find(Z_ARRVAL_PP(data), PS(session_name),
+ zend_ascii_hash_find(Z_ARRVAL_PP(data), PS(session_name),
lensess + 1, (void **) &ppid) == SUCCESS) {
PPID2SID;
PS(apply_trans_sid) = 0;
@@ -1100,20 +1100,20 @@ PHPAPI void php_session_start(TSRMLS_D)
}
if (!PS(use_only_cookies) && !PS(id) &&
- zend_hash_find(&EG(symbol_table), "_GET",
+ zend_ascii_hash_find(&EG(symbol_table), "_GET",
sizeof("_GET"), (void **) &data) == SUCCESS &&
Z_TYPE_PP(data) == IS_ARRAY &&
- zend_hash_find(Z_ARRVAL_PP(data), PS(session_name),
+ zend_rt_hash_find(Z_ARRVAL_PP(data), PS(session_name),
lensess + 1, (void **) &ppid) == SUCCESS) {
PPID2SID;
PS(send_cookie) = 0;
}
if (!PS(use_only_cookies) && !PS(id) &&
- zend_hash_find(&EG(symbol_table), "_POST",
+ zend_ascii_hash_find(&EG(symbol_table), "_POST",
sizeof("_POST"), (void **) &data) == SUCCESS &&
Z_TYPE_PP(data) == IS_ARRAY &&
- zend_hash_find(Z_ARRVAL_PP(data), PS(session_name),
+ zend_rt_hash_find(Z_ARRVAL_PP(data), PS(session_name),
lensess + 1, (void **) &ppid) == SUCCESS) {
PPID2SID;
PS(send_cookie) = 0;
@@ -1125,7 +1125,7 @@ PHPAPI void php_session_start(TSRMLS_D)
http://yoursite/<session-name>=<session-id>/script.php */
if (!PS(use_only_cookies) && !PS(id) && PG(http_globals)[TRACK_VARS_SERVER] &&
- zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "REQUEST_URI",
+ zend_ascii_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "REQUEST_URI",
sizeof("REQUEST_URI"), (void **) &data) == SUCCESS &&
Z_TYPE_PP(data) == IS_STRING &&
(p = strstr(Z_STRVAL_PP(data), PS(session_name))) &&
@@ -1250,11 +1250,11 @@ PHP_FUNCTION(session_get_cookie_params)
array_init(return_value);
- add_assoc_long(return_value, "lifetime", PS(cookie_lifetime));
- add_assoc_string(return_value, "path", PS(cookie_path), 1);
- add_assoc_string(return_value, "domain", PS(cookie_domain), 1);
- add_assoc_bool(return_value, "secure", PS(cookie_secure));
- add_assoc_bool(return_value, "httponly", PS(cookie_httponly));
+ add_ascii_assoc_long(return_value, "lifetime", PS(cookie_lifetime));
+ add_ascii_assoc_rt_string(return_value, "path", PS(cookie_path), 1);
+ add_ascii_assoc_rt_string(return_value, "domain", PS(cookie_domain), 1);
+ add_ascii_assoc_bool(return_value, "secure", PS(cookie_secure));
+ add_ascii_assoc_bool(return_value, "httponly", PS(cookie_httponly));
}
/* }}} */
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 9e460da568..85b39a7fbc 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -996,7 +996,16 @@ static HashTable * sxe_properties_get(zval *object TSRMLS_DC)
array_init(zattr);
sxe_properties_add(rv, "@attributes", sizeof("@attributes"), zattr TSRMLS_CC);
}
- add_assoc_zval_ex(zattr, (char*)attr->name, namelen, value);
+ if (UG(unicode)) {
+ UErrorCode status = U_ZERO_ERROR;
+ zstr u_name;
+ int u_name_len;
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)attr->name, namelen, &status);
+ add_u_assoc_zval_ex(zattr, IS_UNICODE, u_name, u_name_len, value);
+ efree(u_name.u);
+ } else {
+ add_assoc_zval_ex(zattr, (char*)attr->name, namelen, value);
+ }
}
attr = attr->next;
}
@@ -1288,14 +1297,17 @@ static inline void sxe_add_namespace_name(zval *return_value, xmlNsPtr ns TSRMLS
prefix_len = strlen(prefix) + 1;
- if (zend_hash_exists(Z_ARRVAL_P(return_value), prefix, prefix_len) == 0) {
+ if (zend_ascii_hash_exists(Z_ARRVAL_P(return_value), prefix, prefix_len) == 0) {
if (UG(unicode)) {
UErrorCode status = U_ZERO_ERROR;
UChar *u_str;
- int u_len;
+ zstr u_prefix;
+ int u_len, u_prefix_len;
int length = strlen((char*)ns->href);
zend_string_to_unicode_ex(UG(utf8_conv), &u_str, &u_len, (char*)ns->href, length, &status);
- add_assoc_unicodel_ex(return_value, prefix, prefix_len, u_str, u_len, 0);
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_prefix.u, &u_prefix_len, prefix, prefix_len, &status);
+ add_u_assoc_unicodel_ex(return_value, IS_UNICODE, u_prefix, u_prefix_len, u_str, u_len, 0);
+ efree(u_prefix.u);
} else {
add_assoc_string_ex(return_value, prefix, prefix_len, (char*)ns->href, 1);
}
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 91bf447384..4b5c90b985 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1018,7 +1018,7 @@ static zval* get_zval_property(zval* object, char* name TSRMLS_DC)
} else if (Z_TYPE_P(object) == IS_ARRAY) {
zval **data_ptr;
- if (zend_hash_find(Z_ARRVAL_P(object), name, strlen(name)+1, (void**)&data_ptr) == SUCCESS) {
+ if (zend_rt_hash_find(Z_ARRVAL_P(object), name, strlen(name)+1, (void**)&data_ptr) == SUCCESS) {
return *data_ptr;
}
}
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
index 20cc1b8913..b688964cf1 100644
--- a/ext/soap/php_packet_soap.c
+++ b/ext/soap/php_packet_soap.c
@@ -318,7 +318,16 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
tmp = master_to_zval(NULL, val);
}
}
- add_assoc_zval(return_value, param->paramName, tmp);
+ if (UG(unicode)) {
+ UErrorCode status = U_ZERO_ERROR;
+ zstr u_name;
+ int u_name_len;
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, param->paramName, strlen(param->paramName), &status);
+ add_u_assoc_zval_ex(return_value, IS_UNICODE, u_name, u_name_len+1, tmp);
+ efree(u_name.u);
+ } else {
+ add_assoc_zval(return_value, param->paramName, tmp);
+ }
param_count++;
@@ -339,7 +348,16 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
tmp = master_to_zval(NULL, val);
if (val->name) {
- add_assoc_zval(return_value, (char*)val->name, tmp);
+ if (UG(unicode)) {
+ UErrorCode status = U_ZERO_ERROR;
+ zstr u_name;
+ int u_name_len;
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)val->name, strlen((char*)val->name), &status);
+ add_u_assoc_zval_ex(return_value, IS_UNICODE, u_name, u_name_len+1, tmp);
+ efree(u_name.u);
+ } else {
+ add_assoc_zval(return_value, (char*)val->name, tmp);
+ }
} else {
add_next_index_zval(return_value, tmp);
}
@@ -391,7 +409,16 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
smart_str_free(&key);
}
val = master_to_zval(enc, trav);
- add_assoc_zval(soap_headers, (char*)trav->name, val);
+ if (UG(unicode)) {
+ UErrorCode status = U_ZERO_ERROR;
+ zstr u_name;
+ int u_name_len;
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)trav->name, strlen((char*)trav->name), &status);
+ add_u_assoc_zval_ex(soap_headers, IS_UNICODE, u_name, u_name_len+1, val);
+ efree(u_name.u);
+ } else {
+ add_assoc_zval(soap_headers, (char*)trav->name, val);
+ }
}
trav = trav->next;
}
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 91d3a07181..f5bf40ca83 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -1236,14 +1236,14 @@ PHP_METHOD(SoapServer, SoapServer)
HashTable *ht = Z_ARRVAL_P(options);
zval **tmp;
- if (zend_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) {
+ if (zend_ascii_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) {
if (Z_TYPE_PP(tmp) == IS_LONG ||
(Z_LVAL_PP(tmp) == SOAP_1_1 && Z_LVAL_PP(tmp) == SOAP_1_2)) {
version = Z_LVAL_PP(tmp);
}
}
- if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS) {
+ if (zend_ascii_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
service->uri = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
} else if (Z_TYPE_PP(tmp) == IS_UNICODE) {
@@ -1251,7 +1251,7 @@ PHP_METHOD(SoapServer, SoapServer)
}
}
- if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) {
+ if (zend_ascii_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
service->actor = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
} else if (Z_TYPE_PP(tmp) == IS_UNICODE) {
@@ -1259,7 +1259,7 @@ PHP_METHOD(SoapServer, SoapServer)
}
}
- if (zend_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
xmlCharEncodingHandlerPtr encoding;
char *str;
@@ -1280,7 +1280,7 @@ PHP_METHOD(SoapServer, SoapServer)
}
}
- if (zend_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_ARRAY) {
zval *ztmp;
@@ -1289,12 +1289,12 @@ PHP_METHOD(SoapServer, SoapServer)
zend_hash_copy(service->class_map, (*tmp)->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &ztmp, sizeof(zval *));
}
- if (zend_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG) {
service->features = Z_LVAL_PP(tmp);
}
- if (zend_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG) {
cache_wsdl = Z_LVAL_PP(tmp);
}
@@ -1777,16 +1777,16 @@ PHP_METHOD(SoapServer, handle)
}
if (ZEND_NUM_ARGS() == 0) {
- if (zend_hash_find(&EG(symbol_table), HTTP_RAW_POST_DATA, sizeof(HTTP_RAW_POST_DATA), (void **) &raw_post) != FAILURE &&
+ if (zend_ascii_hash_find(&EG(symbol_table), HTTP_RAW_POST_DATA, sizeof(HTTP_RAW_POST_DATA), (void **) &raw_post) != FAILURE &&
(Z_TYPE_PP(raw_post) == IS_STRING ||
Z_TYPE_PP(raw_post) == IS_UNICODE)) {
if (Z_TYPE_PP(raw_post) == IS_STRING) {
zval **server_vars, **encoding;
zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC);
- if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &server_vars) == SUCCESS &&
+ if (zend_ascii_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &server_vars) == SUCCESS &&
Z_TYPE_PP(server_vars) == IS_ARRAY &&
- zend_hash_find(Z_ARRVAL_PP(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING"), (void **) &encoding)==SUCCESS &&
+ zend_ascii_hash_find(Z_ARRVAL_PP(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING"), (void **) &encoding)==SUCCESS &&
(Z_TYPE_PP(encoding) == IS_STRING || Z_TYPE_PP(encoding) == IS_UNICODE)) {
zval func;
zval retval;
@@ -1892,7 +1892,7 @@ PHP_METHOD(SoapServer, handle)
}
/* Find the soap object and assign */
- if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), (void **) &tmp_soap) == SUCCESS &&
+ if (zend_ascii_hash_find(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), (void **) &tmp_soap) == SUCCESS &&
Z_TYPE_PP(tmp_soap) == IS_OBJECT &&
Z_OBJCE_PP(tmp_soap) == service->soap_class.ce) {
soap_obj = *tmp_soap;
@@ -1968,7 +1968,7 @@ PHP_METHOD(SoapServer, handle)
/* If session then update session hash with new object */
if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) {
zval **tmp_soap_pp;
- if (zend_hash_update(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), &tmp_soap, sizeof(zval *), (void **)&tmp_soap_pp) == SUCCESS) {
+ if (zend_ascii_hash_update(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), &tmp_soap, sizeof(zval *), (void **)&tmp_soap_pp) == SUCCESS) {
soap_obj = *tmp_soap_pp;
}
} else {
@@ -2534,7 +2534,7 @@ PHP_METHOD(SoapClient, SoapClient)
if (wsdl == NULL) {
/* Fetching non-WSDL mode options */
- if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
client->uri = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
@@ -2546,25 +2546,25 @@ PHP_METHOD(SoapClient, SoapClient)
return;
}
- if (zend_hash_find(ht, "style", sizeof("style"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "style", sizeof("style"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG &&
(Z_LVAL_PP(tmp) == SOAP_RPC || Z_LVAL_PP(tmp) == SOAP_DOCUMENT)) {
client->style = Z_LVAL_PP(tmp);
}
- if (zend_hash_find(ht, "use", sizeof("use"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "use", sizeof("use"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG &&
(Z_LVAL_PP(tmp) == SOAP_LITERAL || Z_LVAL_PP(tmp) == SOAP_ENCODED)) {
client->use = Z_LVAL_PP(tmp);
}
}
- if (zend_hash_find(ht, "stream_context", sizeof("stream_context"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "stream_context", sizeof("stream_context"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_RESOURCE) {
context = php_stream_context_from_zval(*tmp, 1);
}
- if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
client->location = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
@@ -2576,20 +2576,20 @@ PHP_METHOD(SoapClient, SoapClient)
return;
}
- if (zend_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) {
+ if (zend_ascii_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) {
if (Z_TYPE_PP(tmp) == IS_LONG ||
(Z_LVAL_PP(tmp) == SOAP_1_1 && Z_LVAL_PP(tmp) == SOAP_1_2)) {
soap_version = Z_LVAL_PP(tmp);
}
}
- if (zend_hash_find(ht, "login", sizeof("login"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "login", sizeof("login"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
client->login = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
} else {
client->login = soap_unicode_to_string(Z_USTRVAL_PP(tmp), Z_USTRLEN_PP(tmp) TSRMLS_CC);
}
- if (zend_hash_find(ht, "password", sizeof("password"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "password", sizeof("password"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
client->password = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
@@ -2597,31 +2597,31 @@ PHP_METHOD(SoapClient, SoapClient)
client->password = soap_unicode_to_string(Z_USTRVAL_PP(tmp), Z_USTRLEN_PP(tmp) TSRMLS_CC);
}
}
- if (zend_hash_find(ht, "authentication", sizeof("authentication"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "authentication", sizeof("authentication"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG &&
Z_LVAL_PP(tmp) == SOAP_AUTHENTICATION_DIGEST) {
client->digest = 1;
}
}
- if (zend_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
client->proxy_host = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
} else {
client->proxy_host = soap_unicode_to_string(Z_USTRVAL_PP(tmp), Z_USTRLEN_PP(tmp) TSRMLS_CC);
}
- if (zend_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG) {
client->proxy_port = Z_LVAL_PP(tmp);
}
- if (zend_hash_find(ht, "proxy_login", sizeof("proxy_login"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "proxy_login", sizeof("proxy_login"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
client->proxy_login = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
} else {
client->proxy_login = soap_unicode_to_string(Z_USTRVAL_PP(tmp), Z_USTRLEN_PP(tmp) TSRMLS_CC);
}
- if (zend_hash_find(ht, "proxy_password", sizeof("proxy_password"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "proxy_password", sizeof("proxy_password"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
client->proxy_password = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
@@ -2631,28 +2631,28 @@ PHP_METHOD(SoapClient, SoapClient)
}
}
}
- if (zend_hash_find(ht, "local_cert", sizeof("local_cert"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "local_cert", sizeof("local_cert"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
if (!context) {
context = php_stream_context_alloc();
}
php_stream_context_set_option(context, "ssl", "local_cert", *tmp);
- if (zend_hash_find(ht, "passphrase", sizeof("passphrase"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "passphrase", sizeof("passphrase"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
php_stream_context_set_option(context, "ssl", "passphrase", *tmp);
}
}
- if (zend_hash_find(ht, "trace", sizeof("trace"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "trace", sizeof("trace"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) &&
Z_LVAL_PP(tmp) == 1) {
client->trace = 1;
}
- if (zend_hash_find(ht, "exceptions", sizeof("exceptions"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "exceptions", sizeof("exceptions"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) &&
Z_LVAL_PP(tmp) == 0) {
client->exceptions = 0;
}
- if (zend_hash_find(ht, "compression", sizeof("compression"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "compression", sizeof("compression"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG &&
zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate")) &&
zend_hash_exists(EG(function_table), "gzdeflate", sizeof("gzdeflate")) &&
@@ -2661,7 +2661,7 @@ PHP_METHOD(SoapClient, SoapClient)
zend_hash_exists(EG(function_table), "gzencode", sizeof("gzencode"))) {
client->compression = Z_LVAL_PP(tmp);
}
- if (zend_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
xmlCharEncodingHandlerPtr encoding;
char *str;
@@ -2681,7 +2681,7 @@ PHP_METHOD(SoapClient, SoapClient)
efree(str);
}
}
- if (zend_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_ARRAY) {
zval *ztmp;
@@ -2690,12 +2690,12 @@ PHP_METHOD(SoapClient, SoapClient)
zend_hash_copy(client->class_map, (*tmp)->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &ztmp, sizeof(zval *));
}
- if (zend_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG) {
client->features = Z_LVAL_PP(tmp);
}
- if (zend_hash_find(ht, "connection_timeout", sizeof("connection_timeout"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "connection_timeout", sizeof("connection_timeout"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG && Z_LVAL_PP(tmp) >= 0) {
client->connection_timeout = Z_LVAL_PP(tmp);
}
@@ -2704,12 +2704,12 @@ PHP_METHOD(SoapClient, SoapClient)
client->stream_context = context;
}
- if (zend_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG) {
cache_wsdl = Z_LVAL_PP(tmp);
}
- if (zend_hash_find(ht, "user_agent", sizeof("user_agent"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "user_agent", sizeof("user_agent"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
client->user_agent = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
@@ -3053,7 +3053,7 @@ PHP_METHOD(SoapClient, __call)
if (options) {
if (Z_TYPE_P(options) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(options);
- if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
location = Z_STRVAL_PP(tmp);
@@ -3063,7 +3063,7 @@ PHP_METHOD(SoapClient, __call)
}
}
- if (zend_hash_find(ht, "soapaction", sizeof("soapaction"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "soapaction", sizeof("soapaction"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
soap_action = Z_STRVAL_PP(tmp);
@@ -3073,7 +3073,7 @@ PHP_METHOD(SoapClient, __call)
}
}
- if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS &&
+ if (zend_ascii_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS &&
(Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
uri = Z_STRVAL_PP(tmp);
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index 812e8f08ea..64ea9dcd09 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -1702,7 +1702,7 @@ PHP_FUNCTION(sqlite_fetch_column_types)
zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, tmp, strlen(tmp), &status);
if (result_type == PHPSQLITE_ASSOC) {
- add_assoc_unicode(return_value, colname, u_str, 1);
+ add_rt_assoc_unicode(return_value, colname, u_str, 1);
}
if (result_type == PHPSQLITE_NUM) {
add_index_unicode(return_value, i, u_str, 1);
@@ -1885,12 +1885,12 @@ static void php_sqlite_fetch_array(struct php_sqlite_result *res, int mode, zend
if (mode & PHPSQLITE_ASSOC) {
add_index_zval(return_value, j, decoded);
ZVAL_ADDREF(decoded);
- add_assoc_zval(return_value, (char*)colnames[j], decoded);
+ add_rt_assoc_zval(return_value, (char*)colnames[j], decoded);
} else {
add_next_index_zval(return_value, decoded);
}
} else {
- add_assoc_zval(return_value, (char*)colnames[j], decoded);
+ add_rt_assoc_zval(return_value, (char*)colnames[j], decoded);
}
}
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index f9782bf0a9..5463289149 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -4484,8 +4484,8 @@ PHP_FUNCTION(getopt)
* in order to be on the safe side, even though it is also available
* from the symbol table.
*/
- if (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), (void **) &args) != FAILURE ||
- zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void **) &args) != FAILURE) {
+ if (zend_ascii_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), (void **) &args) != FAILURE ||
+ zend_ascii_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void **) &args) != FAILURE) {
int pos = 0;
zval **arg;
@@ -4702,8 +4702,8 @@ PHP_FUNCTION(time_nanosleep)
RETURN_TRUE;
} else if (errno == EINTR) {
array_init(return_value);
- add_assoc_long_ex(return_value, "seconds", sizeof("seconds"), php_rem.tv_sec);
- add_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds"), php_rem.tv_nsec);
+ add_ascii_assoc_long_ex(return_value, "seconds", sizeof("seconds"), php_rem.tv_sec);
+ add_ascii_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds"), php_rem.tv_nsec);
return;
} else if (errno == EINVAL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative");
@@ -4967,10 +4967,10 @@ PHP_FUNCTION(error_get_last)
}
if (PG(last_error_message)) {
array_init(return_value);
- add_assoc_long_ex(return_value, "type", sizeof("type"), PG(last_error_type));
- add_assoc_string_ex(return_value, "message", sizeof("message"), PG(last_error_message), 1);
- add_assoc_string_ex(return_value, "file", sizeof("file"), PG(last_error_file)?PG(last_error_file):"-", 1 );
- add_assoc_long_ex(return_value, "line", sizeof("line"), PG(last_error_lineno));
+ add_ascii_assoc_long_ex(return_value, "type", sizeof("type"), PG(last_error_type));
+ add_ascii_assoc_string_ex(return_value, "message", sizeof("message"), PG(last_error_message), 1);
+ add_ascii_assoc_string_ex(return_value, "file", sizeof("file"), PG(last_error_file)?PG(last_error_file):"-", 1 );
+ add_ascii_assoc_long_ex(return_value, "line", sizeof("line"), PG(last_error_lineno));
}
}
/* }}} */
@@ -5521,22 +5521,22 @@ static int php_ini_get_option(zend_ini_entry *ini_entry, int num_args, va_list a
array_init(option);
if (ini_entry->orig_value) {
- add_assoc_stringl(option, "global_value", ini_entry->orig_value, ini_entry->orig_value_length, 1);
+ add_ascii_assoc_stringl(option, "global_value", ini_entry->orig_value, ini_entry->orig_value_length, 1);
} else if (ini_entry->value) {
- add_assoc_stringl(option, "global_value", ini_entry->value, ini_entry->value_length, 1);
+ add_ascii_assoc_stringl(option, "global_value", ini_entry->value, ini_entry->value_length, 1);
} else {
- add_assoc_null(option, "global_value");
+ add_ascii_assoc_null(option, "global_value");
}
if (ini_entry->value) {
- add_assoc_stringl(option, "local_value", ini_entry->value, ini_entry->value_length, 1);
+ add_ascii_assoc_stringl(option, "local_value", ini_entry->value, ini_entry->value_length, 1);
} else {
- add_assoc_null(option, "local_value");
+ add_ascii_assoc_null(option, "local_value");
}
- add_assoc_long(option, "access", ini_entry->modifiable);
+ add_ascii_assoc_long(option, "access", ini_entry->modifiable);
- add_assoc_zval_ex(ini_array, ini_entry->name, ini_entry->name_length, option);
+ add_ascii_assoc_zval_ex(ini_array, ini_entry->name, ini_entry->name_length, option);
}
return 0;
}
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index ddb7249b35..80416362c3 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -109,15 +109,15 @@ PHP_FUNCTION(strptime)
}
array_init(return_value);
- add_assoc_long(return_value, "tm_sec", parsed_time.tm_sec);
- add_assoc_long(return_value, "tm_min", parsed_time.tm_min);
- add_assoc_long(return_value, "tm_hour", parsed_time.tm_hour);
- add_assoc_long(return_value, "tm_mday", parsed_time.tm_mday);
- add_assoc_long(return_value, "tm_mon", parsed_time.tm_mon);
- add_assoc_long(return_value, "tm_year", parsed_time.tm_year);
- add_assoc_long(return_value, "tm_wday", parsed_time.tm_wday);
- add_assoc_long(return_value, "tm_yday", parsed_time.tm_yday);
- add_assoc_string(return_value, "unparsed", unparsed_part, 1);
+ add_ascii_assoc_long(return_value, "tm_sec", parsed_time.tm_sec);
+ add_ascii_assoc_long(return_value, "tm_min", parsed_time.tm_min);
+ add_ascii_assoc_long(return_value, "tm_hour", parsed_time.tm_hour);
+ add_ascii_assoc_long(return_value, "tm_mday", parsed_time.tm_mday);
+ add_ascii_assoc_long(return_value, "tm_mon", parsed_time.tm_mon);
+ add_ascii_assoc_long(return_value, "tm_year", parsed_time.tm_year);
+ add_ascii_assoc_long(return_value, "tm_wday", parsed_time.tm_wday);
+ add_ascii_assoc_long(return_value, "tm_yday", parsed_time.tm_yday);
+ add_ascii_assoc_string(return_value, "unparsed", unparsed_part, 1);
}
/* }}} */
#endif
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 8497296486..2bed0eb5fc 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -426,82 +426,82 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
ALLOC_INIT_ZVAL(*subarray);
array_init(*subarray);
- add_assoc_string(*subarray, "host", name, 1);
+ add_ascii_assoc_string(*subarray, "host", name, 1);
switch (type) {
case DNS_T_A:
- add_assoc_string(*subarray, "type", "A", 1);
+ add_ascii_assoc_string(*subarray, "type", "A", 1);
sprintf(name, "%d.%d.%d.%d", cp[0], cp[1], cp[2], cp[3]);
- add_assoc_string(*subarray, "ip", name, 1);
+ add_ascii_assoc_string(*subarray, "ip", name, 1);
cp += dlen;
break;
case DNS_T_MX:
- add_assoc_string(*subarray, "type", "MX", 1);
+ add_ascii_assoc_string(*subarray, "type", "MX", 1);
GETSHORT(n, cp);
- add_assoc_long(*subarray, "pri", n);
+ add_ascii_assoc_long(*subarray, "pri", n);
/* no break; */
case DNS_T_CNAME:
if (type == DNS_T_CNAME)
- add_assoc_string(*subarray, "type", "CNAME", 1);
+ add_ascii_assoc_string(*subarray, "type", "CNAME", 1);
/* no break; */
case DNS_T_NS:
if (type == DNS_T_NS)
- add_assoc_string(*subarray, "type", "NS", 1);
+ add_ascii_assoc_string(*subarray, "type", "NS", 1);
/* no break; */
case DNS_T_PTR:
if (type == DNS_T_PTR)
- add_assoc_string(*subarray, "type", "PTR", 1);
+ add_ascii_assoc_string(*subarray, "type", "PTR", 1);
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2);
if (n < 0) {
return NULL;
}
cp += n;
- add_assoc_string(*subarray, "target", name, 1);
+ add_ascii_assoc_string(*subarray, "target", name, 1);
break;
case DNS_T_HINFO:
/* See RFC 1010 for values */
- add_assoc_string(*subarray, "type", "HINFO", 1);
+ add_ascii_assoc_string(*subarray, "type", "HINFO", 1);
n = *cp & 0xFF;
cp++;
- add_assoc_stringl(*subarray, "cpu", (char*)cp, n, 1);
+ add_ascii_assoc_stringl(*subarray, "cpu", (char*)cp, n, 1);
cp += n;
n = *cp & 0xFF;
cp++;
- add_assoc_stringl(*subarray, "os", (char*)cp, n, 1);
+ add_ascii_assoc_stringl(*subarray, "os", (char*)cp, n, 1);
cp += n;
break;
case DNS_T_TXT:
- add_assoc_string(*subarray, "type", "TXT", 1);
+ add_ascii_assoc_string(*subarray, "type", "TXT", 1);
n = cp[0];
tp = emalloc(n + 1);
memcpy(tp, cp + 1, n);
tp[n] = '\0';
cp += dlen;
- add_assoc_stringl(*subarray, "txt", (char*)tp, n, 0);
+ add_ascii_assoc_stringl(*subarray, "txt", (char*)tp, n, 0);
break;
case DNS_T_SOA:
- add_assoc_string(*subarray, "type", "SOA", 1);
+ add_ascii_assoc_string(*subarray, "type", "SOA", 1);
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) -2);
if (n < 0) {
return NULL;
}
cp += n;
- add_assoc_string(*subarray, "mname", name, 1);
+ add_ascii_assoc_string(*subarray, "mname", name, 1);
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) -2);
if (n < 0) {
return NULL;
}
cp += n;
- add_assoc_string(*subarray, "rname", name, 1);
+ add_ascii_assoc_string(*subarray, "rname", name, 1);
GETLONG(n, cp);
- add_assoc_long(*subarray, "serial", n);
+ add_ascii_assoc_long(*subarray, "serial", n);
GETLONG(n, cp);
- add_assoc_long(*subarray, "refresh", n);
+ add_ascii_assoc_long(*subarray, "refresh", n);
GETLONG(n, cp);
- add_assoc_long(*subarray, "retry", n);
+ add_ascii_assoc_long(*subarray, "retry", n);
GETLONG(n, cp);
- add_assoc_long(*subarray, "expire", n);
+ add_ascii_assoc_long(*subarray, "expire", n);
GETLONG(n, cp);
- add_assoc_long(*subarray, "minimum-ttl", n);
+ add_ascii_assoc_long(*subarray, "minimum-ttl", n);
break;
case DNS_T_AAAA:
tp = (u_char*)name;
@@ -533,15 +533,15 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
tp++;
}
tp[0] = '\0';
- add_assoc_string(*subarray, "type", "AAAA", 1);
- add_assoc_string(*subarray, "ipv6", name, 1);
+ add_ascii_assoc_string(*subarray, "type", "AAAA", 1);
+ add_ascii_assoc_string(*subarray, "ipv6", name, 1);
break;
case DNS_T_A6:
p = cp;
- add_assoc_string(*subarray, "type", "A6", 1);
+ add_ascii_assoc_string(*subarray, "type", "A6", 1);
n = ((int)cp[0]) & 0xFF;
cp++;
- add_assoc_long(*subarray, "masklen", n);
+ add_ascii_assoc_long(*subarray, "masklen", n);
tp = (u_char*)name;
if (n > 15) {
have_v6_break = 1;
@@ -601,59 +601,59 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
tp++;
}
tp[0] = '\0';
- add_assoc_string(*subarray, "ipv6", name, 1);
+ add_ascii_assoc_string(*subarray, "ipv6", name, 1);
if (cp < p + dlen) {
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2);
if (n < 0) {
return NULL;
}
cp += n;
- add_assoc_string(*subarray, "chain", name, 1);
+ add_ascii_assoc_string(*subarray, "chain", name, 1);
}
break;
case DNS_T_SRV:
- add_assoc_string(*subarray, "type", "SRV", 1);
+ add_ascii_assoc_string(*subarray, "type", "SRV", 1);
GETSHORT(n, cp);
- add_assoc_long(*subarray, "pri", n);
+ add_ascii_assoc_long(*subarray, "pri", n);
GETSHORT(n, cp);
- add_assoc_long(*subarray, "weight", n);
+ add_ascii_assoc_long(*subarray, "weight", n);
GETSHORT(n, cp);
- add_assoc_long(*subarray, "port", n);
+ add_ascii_assoc_long(*subarray, "port", n);
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2);
if (n < 0) {
return NULL;
}
cp += n;
- add_assoc_string(*subarray, "target", name, 1);
+ add_ascii_assoc_string(*subarray, "target", name, 1);
break;
case DNS_T_NAPTR:
- add_assoc_string(*subarray, "type", "NAPTR", 1);
+ add_ascii_assoc_string(*subarray, "type", "NAPTR", 1);
GETSHORT(n, cp);
- add_assoc_long(*subarray, "order", n);
+ add_ascii_assoc_long(*subarray, "order", n);
GETSHORT(n, cp);
- add_assoc_long(*subarray, "pref", n);
+ add_ascii_assoc_long(*subarray, "pref", n);
n = (cp[0] & 0xFF);
- add_assoc_stringl(*subarray, "flags", (char*)++cp, n, 1);
+ add_ascii_assoc_stringl(*subarray, "flags", (char*)++cp, n, 1);
cp += n;
n = (cp[0] & 0xFF);
- add_assoc_stringl(*subarray, "services", (char*)++cp, n, 1);
+ add_ascii_assoc_stringl(*subarray, "services", (char*)++cp, n, 1);
cp += n;
n = (cp[0] & 0xFF);
- add_assoc_stringl(*subarray, "regex", (char*)++cp, n, 1);
+ add_ascii_assoc_stringl(*subarray, "regex", (char*)++cp, n, 1);
cp += n;
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2);
if (n < 0) {
return NULL;
}
cp += n;
- add_assoc_string(*subarray, "replacement", name, 1);
+ add_ascii_assoc_string(*subarray, "replacement", name, 1);
break;
default:
cp += dlen;
}
- add_assoc_string(*subarray, "class", "IN", 1);
- add_assoc_long(*subarray, "ttl", ttl);
+ add_ascii_assoc_string(*subarray, "class", "IN", 1);
+ add_ascii_assoc_long(*subarray, "ttl", ttl);
return cp;
}
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 6e6c1faf23..298735933e 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1748,19 +1748,19 @@ PHP_NAMED_FUNCTION(php_if_fstat)
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_blocks, sizeof(zval *), NULL);
/* Store string indexes referencing the same zval*/
- zend_hash_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0])+1, (void *)&stat_dev, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1])+1, (void *)&stat_ino, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2])+1, (void *)&stat_mode, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3])+1, (void *)&stat_nlink, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4])+1, (void *)&stat_uid, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5])+1, (void *)&stat_gid, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6])+1, (void *)&stat_rdev, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7])+1, (void *)&stat_size, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8])+1, (void *)&stat_atime, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9])+1, (void *)&stat_mtime, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10])+1, (void *)&stat_ctime, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11])+1, (void *)&stat_blksize, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12])+1, (void *)&stat_blocks, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0])+1, (void *)&stat_dev, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1])+1, (void *)&stat_ino, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2])+1, (void *)&stat_mode, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3])+1, (void *)&stat_nlink, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4])+1, (void *)&stat_uid, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5])+1, (void *)&stat_gid, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6])+1, (void *)&stat_rdev, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7])+1, (void *)&stat_size, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8])+1, (void *)&stat_atime, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9])+1, (void *)&stat_mtime, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10])+1, (void *)&stat_ctime, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11])+1, (void *)&stat_blksize, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12])+1, (void *)&stat_blocks, sizeof(zval *), NULL);
}
/* }}} */
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 313f89a1e7..c5aa8cc8b3 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -831,19 +831,19 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_blocks, sizeof(zval *), NULL);
/* Store string indexes referencing the same zval*/
- zend_hash_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0])+1, (void *) &stat_dev, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1])+1, (void *) &stat_ino, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2])+1, (void *) &stat_mode, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3])+1, (void *) &stat_nlink, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4])+1, (void *) &stat_uid, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5])+1, (void *) &stat_gid, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6])+1, (void *) &stat_rdev, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7])+1, (void *) &stat_size, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8])+1, (void *) &stat_atime, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9])+1, (void *) &stat_mtime, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10])+1, (void *) &stat_ctime, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11])+1, (void *) &stat_blksize, sizeof(zval *), NULL);
- zend_hash_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12])+1, (void *) &stat_blocks, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0])+1, (void *) &stat_dev, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1])+1, (void *) &stat_ino, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2])+1, (void *) &stat_mode, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3])+1, (void *) &stat_nlink, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4])+1, (void *) &stat_uid, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5])+1, (void *) &stat_gid, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6])+1, (void *) &stat_rdev, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7])+1, (void *) &stat_size, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8])+1, (void *) &stat_atime, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9])+1, (void *) &stat_mtime, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10])+1, (void *) &stat_ctime, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11])+1, (void *) &stat_blksize, sizeof(zval *), NULL);
+ zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12])+1, (void *) &stat_blocks, sizeof(zval *), NULL);
return;
}
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 8376ee81ce..ee3e39af70 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -512,7 +512,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
{
zval **rh;
- zend_hash_find(EG(active_symbol_table), "http_response_header", sizeof("http_response_header"), (void **) &rh);
+ zend_ascii_hash_find(EG(active_symbol_table), "http_response_header", sizeof("http_response_header"), (void **) &rh);
response_header = *rh;
}
diff --git a/ext/standard/image.c b/ext/standard/image.c
index b6ba4228f9..7476ed17f6 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -456,9 +456,9 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR
sprintf(markername, "APP%d", marker - M_APP0);
- if (zend_hash_find(Z_ARRVAL_P(info), markername, strlen(markername)+1, (void **) &tmp) == FAILURE) {
+ if (zend_ascii_hash_find(Z_ARRVAL_P(info), markername, strlen(markername)+1, (void **) &tmp) == FAILURE) {
/* XXX we onyl catch the 1st tag of it's kind! */
- add_assoc_stringl(info, markername, buffer, length, 1);
+ add_ascii_assoc_stringl(info, markername, buffer, length, 1);
}
efree(buffer);
@@ -1399,13 +1399,13 @@ PHP_FUNCTION(getimagesize)
}
if (result->bits != 0) {
- add_assoc_long(return_value, "bits", result->bits);
+ add_ascii_assoc_long(return_value, "bits", result->bits);
}
if (result->channels != 0) {
- add_assoc_long(return_value, "channels", result->channels);
+ add_ascii_assoc_long(return_value, "channels", result->channels);
}
temp = (char*)php_image_type_to_mime_type(itype);
- add_assoc_ascii_string(return_value, "mime", temp, 1);
+ add_ascii_assoc_ascii_string(return_value, "mime", temp, 1);
efree(result);
} else {
RETURN_FALSE;
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 221cad11ed..491308e489 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -713,16 +713,16 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_table_start();
php_info_print_table_header(2, "Variable", "Value");
- if (zend_hash_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void **) &data) != FAILURE) {
+ if (zend_ascii_hash_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void **) &data) != FAILURE) {
php_info_print_table_row(2, "PHP_SELF", Z_STRVAL_PP(data));
}
- if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE"), (void **) &data) != FAILURE) {
+ if (zend_ascii_hash_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE"), (void **) &data) != FAILURE) {
php_info_print_table_row(2, "PHP_AUTH_TYPE", Z_STRVAL_PP(data));
}
- if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), (void **) &data) != FAILURE) {
+ if (zend_ascii_hash_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), (void **) &data) != FAILURE) {
php_info_print_table_row(2, "PHP_AUTH_USER", Z_STRVAL_PP(data));
}
- if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE) {
+ if (zend_ascii_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE) {
php_info_print_table_row(2, "PHP_AUTH_PW", Z_STRVAL_PP(data));
}
php_print_gpcse_array("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC);
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index 45109ec296..08a6471537 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -357,12 +357,12 @@ PHP_FUNCTION(iptcparse)
array_init(return_value);
}
- if (zend_hash_find(Z_ARRVAL_P(return_value), key, strlen(key) + 1, (void **) &element) == FAILURE) {
+ if (zend_ascii_hash_find(Z_ARRVAL_P(return_value), key, strlen(key) + 1, (void **) &element) == FAILURE) {
ALLOC_ZVAL(values);
INIT_PZVAL(values);
array_init(values);
- zend_hash_update(Z_ARRVAL_P(return_value), key, strlen(key)+1, (void *) &values, sizeof(zval*), (void **) &element);
+ zend_ascii_hash_update(Z_ARRVAL_P(return_value), key, strlen(key)+1, (void *) &values, sizeof(zval*), (void **) &element);
}
add_next_index_stringl(*element, (char*)buffer+inx, len, 1);
diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c
index 36c9409688..c9d8b971eb 100644
--- a/ext/standard/microtime.c
+++ b/ext/standard/microtime.c
@@ -74,11 +74,11 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode)
offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info(TSRMLS_C));
array_init(return_value);
- add_assoc_long(return_value, "sec", tp.tv_sec);
- add_assoc_long(return_value, "usec", tp.tv_usec);
+ add_ascii_assoc_long(return_value, "sec", tp.tv_sec);
+ add_ascii_assoc_long(return_value, "usec", tp.tv_usec);
- add_assoc_long(return_value, "minuteswest", -offset->offset / SEC_IN_MIN);
- add_assoc_long(return_value, "dsttime", offset->is_dst);
+ add_ascii_assoc_long(return_value, "minuteswest", -offset->offset / SEC_IN_MIN);
+ add_ascii_assoc_long(return_value, "dsttime", offset->is_dst);
timelib_time_offset_dtor(offset);
} else {
@@ -127,7 +127,7 @@ PHP_FUNCTION(getrusage)
array_init(return_value);
#define PHP_RUSAGE_PARA(a) \
- add_assoc_long(return_value, #a, usg.a)
+ add_ascii_assoc_long(return_value, #a, usg.a)
#if !defined( _OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct */
PHP_RUSAGE_PARA(ru_oublock);
PHP_RUSAGE_PARA(ru_inblock);
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 5b2d54de6e..62adfbd38e 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -319,8 +319,8 @@ PHP_FUNCTION(proc_get_status)
array_init(return_value);
- add_assoc_string(return_value, "command", proc->command, 1);
- add_assoc_long(return_value, "pid", (long) proc->child);
+ add_ascii_assoc_string(return_value, "command", proc->command, 1);
+ add_ascii_assoc_long(return_value, "pid", (long) proc->child);
#ifdef PHP_WIN32
@@ -357,12 +357,12 @@ PHP_FUNCTION(proc_get_status)
}
#endif
- add_assoc_bool(return_value, "running", running);
- add_assoc_bool(return_value, "signaled", signaled);
- add_assoc_bool(return_value, "stopped", stopped);
- add_assoc_long(return_value, "exitcode", exitcode);
- add_assoc_long(return_value, "termsig", termsig);
- add_assoc_long(return_value, "stopsig", stopsig);
+ add_ascii_assoc_bool(return_value, "running", running);
+ add_ascii_assoc_bool(return_value, "signaled", signaled);
+ add_ascii_assoc_bool(return_value, "stopped", stopped);
+ add_ascii_assoc_long(return_value, "exitcode", exitcode);
+ add_ascii_assoc_long(return_value, "termsig", termsig);
+ add_ascii_assoc_long(return_value, "stopsig", stopsig);
}
/* }}} */
@@ -456,7 +456,7 @@ PHP_FUNCTION(proc_open)
#ifdef PHP_WIN32
if (other_options) {
zval **item;
- if (SUCCESS == zend_hash_find(Z_ARRVAL_P(other_options), "suppress_errors", sizeof("suppress_errors"), (void**)&item)) {
+ if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(other_options), "suppress_errors", sizeof("suppress_errors"), (void**)&item)) {
if (Z_TYPE_PP(item) == IS_BOOL && Z_BVAL_PP(item)) {
suppress_errors = 1;
}
diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c
index b21668836a..cbd5c5bc6f 100644
--- a/ext/standard/scanf.c
+++ b/ext/standard/scanf.c
@@ -656,11 +656,15 @@ PHPAPI int php_sscanf_internal( char *string, char *format,
*/
if (!numVars) {
+ zval *tmp;
+
/* allocate an array for return */
array_init(*return_value);
for (i = 0; i < totalVars; i++) {
- if (add_next_index_null(*return_value) == FAILURE) {
+ MAKE_STD_ZVAL(tmp);
+ ZVAL_NULL(tmp);
+ if (add_next_index_zval(*return_value, tmp) == FAILURE) {
scan_set_error_return(0, return_value);
return FAILURE;
}
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index f07b3acedb..9b08f9c058 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -458,14 +458,14 @@ PHP_FUNCTION(stream_get_meta_data)
zval_copy_ctor(newval);
INIT_PZVAL(newval);
- add_assoc_zval(return_value, "wrapper_data", newval);
+ add_ascii_assoc_zval(return_value, "wrapper_data", newval);
}
if (stream->wrapper) {
- add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label, 1);
+ add_ascii_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label, 1);
}
- add_assoc_string(return_value, "stream_type", (char *)stream->ops->label, 1);
+ add_ascii_assoc_string(return_value, "stream_type", (char *)stream->ops->label, 1);
- add_assoc_string(return_value, "mode", stream->mode, 1);
+ add_ascii_assoc_string(return_value, "mode", stream->mode, 1);
if (stream->readfilters.head) {
php_stream_filter *filter;
@@ -477,7 +477,7 @@ PHP_FUNCTION(stream_get_meta_data)
add_next_index_string(newval, filter->name, 1);
}
- add_assoc_zval(return_value, "read_filters", newval);
+ add_ascii_assoc_zval(return_value, "read_filters", newval);
}
if (stream->writefilters.head) {
@@ -490,27 +490,27 @@ PHP_FUNCTION(stream_get_meta_data)
add_next_index_string(newval, filter->name, 1);
}
- add_assoc_zval(return_value, "write_filters", newval);
+ add_ascii_assoc_zval(return_value, "write_filters", newval);
}
if (stream->readbuf_type == IS_UNICODE) {
int readbuf_len = u_countChar32(stream->readbuf.u + stream->readpos, stream->writepos - stream->readpos);
- add_assoc_long(return_value, "unread_bytes", UBYTES(stream->writepos - stream->readpos));
- add_assoc_long(return_value, "unread_chars", readbuf_len);
+ add_ascii_assoc_long(return_value, "unread_bytes", UBYTES(stream->writepos - stream->readpos));
+ add_ascii_assoc_long(return_value, "unread_chars", readbuf_len);
} else { /* IS_STRING */
- add_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos);
- add_assoc_long(return_value, "unread_chars", stream->writepos - stream->readpos);
+ add_ascii_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos);
+ add_ascii_assoc_long(return_value, "unread_chars", stream->writepos - stream->readpos);
}
- add_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0);
+ add_ascii_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0);
if (stream->orig_path) {
- add_assoc_string(return_value, "uri", stream->orig_path, 1);
+ add_ascii_assoc_string(return_value, "uri", stream->orig_path, 1);
}
if (!php_stream_populate_meta_data(stream, return_value)) {
- add_assoc_bool(return_value, "timed_out", 0);
- add_assoc_bool(return_value, "blocked", 1);
- add_assoc_bool(return_value, "eof", php_stream_eof(stream));
+ add_ascii_assoc_bool(return_value, "timed_out", 0);
+ add_ascii_assoc_bool(return_value, "blocked", 1);
+ add_ascii_assoc_bool(return_value, "eof", php_stream_eof(stream));
}
}
@@ -914,7 +914,7 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS
int ret = SUCCESS;
zval **tmp;
- if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "notification", sizeof("notification"), (void**)&tmp)) {
+ if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "notification", sizeof("notification"), (void**)&tmp)) {
if (context->notifier) {
php_stream_notification_free(context->notifier);
@@ -927,10 +927,10 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS
ZVAL_ADDREF(*tmp);
context->notifier->dtor = user_space_stream_notifier_dtor;
}
- if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "options", sizeof("options"), (void**)&tmp)) {
+ if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "options", sizeof("options"), (void**)&tmp)) {
parse_context_options(context, *tmp TSRMLS_CC);
}
- if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "encoding", sizeof("encoding"), (void**)&tmp)) {
+ if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "encoding", sizeof("encoding"), (void**)&tmp)) {
zval strval = **tmp;
if (context->input_encoding) {
@@ -944,7 +944,7 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS
context->input_encoding = Z_STRVAL(strval);
context->output_encoding = estrdup(Z_STRVAL(strval));
}
- if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "input_encoding", sizeof("input_encoding"), (void**)&tmp)) {
+ if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "input_encoding", sizeof("input_encoding"), (void**)&tmp)) {
zval strval = **tmp;
if (context->input_encoding) {
@@ -955,7 +955,7 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS
convert_to_string(&strval);
context->input_encoding = Z_STRVAL(strval);
}
- if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "output_encoding", sizeof("output_encoding"), (void**)&tmp)) {
+ if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "output_encoding", sizeof("output_encoding"), (void**)&tmp)) {
zval strval = **tmp;
if (context->output_encoding) {
@@ -966,7 +966,7 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS
convert_to_string(&strval);
context->output_encoding = Z_STRVAL(strval);
}
- if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "default_mode", sizeof("default_mode"), (void**)&tmp)) {
+ if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "default_mode", sizeof("default_mode"), (void**)&tmp)) {
zval longval = **tmp;
zval_copy_ctor(&longval);
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 245ac83214..c738b87fbd 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2076,7 +2076,7 @@ PHP_FUNCTION(pathinfo)
ret_len = php_dirname(ret.s, path_len);
}
if (ret_len > 0) {
- add_assoc_zstrl(tmp, "dirname", path_type, ret, ret_len, 1);
+ add_ascii_assoc_zstrl(tmp, "dirname", path_type, ret, ret_len, 1);
}
efree(ret.v);
ret = NULL_ZSTR;
@@ -2091,7 +2091,7 @@ PHP_FUNCTION(pathinfo)
}
if (have_basename) {
- add_assoc_zstrl(tmp, "basename", path_type, ret, ret_len, 0);
+ add_ascii_assoc_zstrl(tmp, "basename", path_type, ret, ret_len, 0);
}
if (have_ext) {
@@ -2113,7 +2113,7 @@ PHP_FUNCTION(pathinfo)
}
if (ext.v) {
- add_assoc_zstrl(tmp, "extension", path_type, ext, ext_len, 1);
+ add_ascii_assoc_zstrl(tmp, "extension", path_type, ext, ext_len, 1);
}
}
@@ -2129,7 +2129,7 @@ PHP_FUNCTION(pathinfo)
idx = p.s ? (p.s - ret.s) : ret_len;
}
- add_assoc_zstrl(tmp, "filename", path_type, ret, idx, 1);
+ add_ascii_assoc_zstrl(tmp, "filename", path_type, ret, idx, 1);
}
if (!have_basename && ret.v) {
@@ -5112,6 +5112,8 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
/* For each subject entry, convert it to string, then perform replacement
and add the result to the return_value array. */
while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void **)&subject_entry) == SUCCESS) {
+ zend_uchar utype;
+
if (Z_TYPE_PP(subject_entry) != IS_ARRAY && Z_TYPE_PP(subject_entry) != IS_OBJECT) {
MAKE_STD_ZVAL(result);
SEPARATE_ZVAL(subject_entry);
@@ -5122,11 +5124,11 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
COPY_PZVAL_TO_ZVAL(*result, *subject_entry);
}
/* Add to return array */
- switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(subject), &string_key,
- &string_key_len, &num_key, 0, NULL)) {
+ switch ((utype = zend_hash_get_current_key_ex(Z_ARRVAL_PP(subject), &string_key,
+ &string_key_len, &num_key, 0, NULL))) {
case HASH_KEY_IS_STRING:
case HASH_KEY_IS_UNICODE:
- add_assoc_zval_ex(return_value, string_key.s, string_key_len, result);
+ add_u_assoc_zval_ex(return_value, utype, string_key, string_key_len, result);
break;
case HASH_KEY_IS_LONG:
@@ -6456,22 +6458,22 @@ PHP_FUNCTION(localeconv)
add_index_long(mon_grouping, i, currlocdata.mon_grouping[i]);
}
- add_assoc_string(return_value, "decimal_point", currlocdata.decimal_point, 1);
- add_assoc_string(return_value, "thousands_sep", currlocdata.thousands_sep, 1);
- add_assoc_string(return_value, "int_curr_symbol", currlocdata.int_curr_symbol, 1);
- add_assoc_string(return_value, "currency_symbol", currlocdata.currency_symbol, 1);
- add_assoc_string(return_value, "mon_decimal_point", currlocdata.mon_decimal_point, 1);
- add_assoc_string(return_value, "mon_thousands_sep", currlocdata.mon_thousands_sep, 1);
- add_assoc_string(return_value, "positive_sign", currlocdata.positive_sign, 1);
- add_assoc_string(return_value, "negative_sign", currlocdata.negative_sign, 1);
- add_assoc_long( return_value, "int_frac_digits", currlocdata.int_frac_digits );
- add_assoc_long( return_value, "frac_digits", currlocdata.frac_digits );
- add_assoc_long( return_value, "p_cs_precedes", currlocdata.p_cs_precedes );
- add_assoc_long( return_value, "p_sep_by_space", currlocdata.p_sep_by_space );
- add_assoc_long( return_value, "n_cs_precedes", currlocdata.n_cs_precedes );
- add_assoc_long( return_value, "n_sep_by_space", currlocdata.n_sep_by_space );
- add_assoc_long( return_value, "p_sign_posn", currlocdata.p_sign_posn );
- add_assoc_long( return_value, "n_sign_posn", currlocdata.n_sign_posn );
+ add_ascii_assoc_string(return_value, "decimal_point", currlocdata.decimal_point, 1);
+ add_ascii_assoc_string(return_value, "thousands_sep", currlocdata.thousands_sep, 1);
+ add_ascii_assoc_string(return_value, "int_curr_symbol", currlocdata.int_curr_symbol, 1);
+ add_ascii_assoc_string(return_value, "currency_symbol", currlocdata.currency_symbol, 1);
+ add_ascii_assoc_string(return_value, "mon_decimal_point", currlocdata.mon_decimal_point, 1);
+ add_ascii_assoc_string(return_value, "mon_thousands_sep", currlocdata.mon_thousands_sep, 1);
+ add_ascii_assoc_string(return_value, "positive_sign", currlocdata.positive_sign, 1);
+ add_ascii_assoc_string(return_value, "negative_sign", currlocdata.negative_sign, 1);
+ add_ascii_assoc_long( return_value, "int_frac_digits", currlocdata.int_frac_digits );
+ add_ascii_assoc_long( return_value, "frac_digits", currlocdata.frac_digits );
+ add_ascii_assoc_long( return_value, "p_cs_precedes", currlocdata.p_cs_precedes );
+ add_ascii_assoc_long( return_value, "p_sep_by_space", currlocdata.p_sep_by_space );
+ add_ascii_assoc_long( return_value, "n_cs_precedes", currlocdata.n_cs_precedes );
+ add_ascii_assoc_long( return_value, "n_sep_by_space", currlocdata.n_sep_by_space );
+ add_ascii_assoc_long( return_value, "p_sign_posn", currlocdata.p_sign_posn );
+ add_ascii_assoc_long( return_value, "n_sign_posn", currlocdata.n_sign_posn );
}
#else
/* Ok, it doesn't look like we have locale info floating around, so I guess it
@@ -6480,26 +6482,26 @@ PHP_FUNCTION(localeconv)
add_index_long(grouping, 0, -1);
add_index_long(mon_grouping, 0, -1);
- add_assoc_string(return_value, "decimal_point", "\x2E", 1);
- add_assoc_string(return_value, "thousands_sep", "", 1);
- add_assoc_string(return_value, "int_curr_symbol", "", 1);
- add_assoc_string(return_value, "currency_symbol", "", 1);
- add_assoc_string(return_value, "mon_decimal_point", "\x2E", 1);
- add_assoc_string(return_value, "mon_thousands_sep", "", 1);
- add_assoc_string(return_value, "positive_sign", "", 1);
- add_assoc_string(return_value, "negative_sign", "", 1);
- add_assoc_long( return_value, "int_frac_digits", CHAR_MAX );
- add_assoc_long( return_value, "frac_digits", CHAR_MAX );
- add_assoc_long( return_value, "p_cs_precedes", CHAR_MAX );
- add_assoc_long( return_value, "p_sep_by_space", CHAR_MAX );
- add_assoc_long( return_value, "n_cs_precedes", CHAR_MAX );
- add_assoc_long( return_value, "n_sep_by_space", CHAR_MAX );
- add_assoc_long( return_value, "p_sign_posn", CHAR_MAX );
- add_assoc_long( return_value, "n_sign_posn", CHAR_MAX );
+ add_ascii_assoc_string(return_value, "decimal_point", "\x2E", 1);
+ add_ascii_assoc_string(return_value, "thousands_sep", "", 1);
+ add_ascii_assoc_string(return_value, "int_curr_symbol", "", 1);
+ add_ascii_assoc_string(return_value, "currency_symbol", "", 1);
+ add_ascii_assoc_string(return_value, "mon_decimal_point", "\x2E", 1);
+ add_ascii_assoc_string(return_value, "mon_thousands_sep", "", 1);
+ add_ascii_assoc_string(return_value, "positive_sign", "", 1);
+ add_ascii_assoc_string(return_value, "negative_sign", "", 1);
+ add_ascii_assoc_long( return_value, "int_frac_digits", CHAR_MAX );
+ add_ascii_assoc_long( return_value, "frac_digits", CHAR_MAX );
+ add_ascii_assoc_long( return_value, "p_cs_precedes", CHAR_MAX );
+ add_ascii_assoc_long( return_value, "p_sep_by_space", CHAR_MAX );
+ add_ascii_assoc_long( return_value, "n_cs_precedes", CHAR_MAX );
+ add_ascii_assoc_long( return_value, "n_sep_by_space", CHAR_MAX );
+ add_ascii_assoc_long( return_value, "p_sign_posn", CHAR_MAX );
+ add_ascii_assoc_long( return_value, "n_sign_posn", CHAR_MAX );
#endif
- zend_hash_update(Z_ARRVAL_P(return_value), "grouping", 9, &grouping, sizeof(zval *), NULL);
- zend_hash_update(Z_ARRVAL_P(return_value), "mon_grouping", 13, &mon_grouping, sizeof(zval *), NULL);
+ zend_ascii_hash_update(Z_ARRVAL_P(return_value), "grouping", 9, &grouping, sizeof(zval *), NULL);
+ zend_ascii_hash_update(Z_ARRVAL_P(return_value), "mon_grouping", 13, &mon_grouping, sizeof(zval *), NULL);
}
/* }}} */
@@ -7076,7 +7078,7 @@ PHP_FUNCTION(str_split)
array_init(return_value);
if (split_length >= str_len) {
- add_next_index_zstrl(return_value, str, str_len, str_type, 1);
+ add_next_index_zstrl(return_value, str_type, str, str_len, 1);
return;
}
@@ -7087,12 +7089,12 @@ PHP_FUNCTION(str_split)
}
while (n_reg_segments-- > 0) {
- add_next_index_zstrl(return_value, ZSTR(p), split_length, str_type, 1);
+ add_next_index_zstrl(return_value, str_type, ZSTR(p), split_length, 1);
p += split_length * charsize;
}
if (p != (str.s + str_len * charsize)) {
- add_next_index_zstrl(return_value, ZSTR(p), (str.s + str_len * charsize - p), str_type, 1);
+ add_next_index_zstrl(return_value, str_type, ZSTR(p), (str.s + str_len * charsize - p), 1);
}
}
/* }}} */
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 2a6a617eb1..ac870f84dc 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -386,21 +386,21 @@ PHP_FUNCTION(parse_url)
/* add the various elements to the array */
if (resource->scheme != NULL)
- add_assoc_string(return_value, "scheme", resource->scheme, 1);
+ add_ascii_assoc_string(return_value, "scheme", resource->scheme, 1);
if (resource->host != NULL)
- add_assoc_string(return_value, "host", resource->host, 1);
+ add_ascii_assoc_string(return_value, "host", resource->host, 1);
if (resource->port != 0)
- add_assoc_long(return_value, "port", resource->port);
+ add_ascii_assoc_long(return_value, "port", resource->port);
if (resource->user != NULL)
- add_assoc_string(return_value, "user", resource->user, 1);
+ add_ascii_assoc_string(return_value, "user", resource->user, 1);
if (resource->pass != NULL)
- add_assoc_string(return_value, "pass", resource->pass, 1);
+ add_ascii_assoc_string(return_value, "pass", resource->pass, 1);
if (resource->path != NULL)
- add_assoc_string(return_value, "path", resource->path, 1);
+ add_ascii_assoc_string(return_value, "path", resource->path, 1);
if (resource->query != NULL)
- add_assoc_string(return_value, "query", resource->query, 1);
+ add_ascii_assoc_string(return_value, "query", resource->query, 1);
if (resource->fragment != NULL)
- add_assoc_string(return_value, "fragment", resource->fragment, 1);
+ add_ascii_assoc_string(return_value, "fragment", resource->fragment, 1);
done:
php_url_free(resource);
}
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 7e427da5f8..86b2b0afc8 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -57,7 +57,7 @@ int php_zlib_output_encoding(TSRMLS_D)
if (!ZLIBG(compression_coding)) {
zend_is_auto_global(ZEND_STRL("_SERVER") TSRMLS_CC);
- if (PG(http_globals)[TRACK_VARS_SERVER] && SUCCESS == zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void *) &enc)) {
+ if (PG(http_globals)[TRACK_VARS_SERVER] && SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void *) &enc)) {
convert_to_string(*enc);
if (strstr(Z_STRVAL_PP(enc), "gzip")) {
ZLIBG(compression_coding) = PHP_ZLIB_ENCODING_GZIP;