summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-02-26 11:57:14 +0000
committerDmitry Stogov <dmitry@php.net>2006-02-26 11:57:14 +0000
commite3b7f3fd0d3884a214c6fda97db14295a076171d (patch)
tree7f8b3d5dcceee2ec5ebe102183a8e99bbbc8e317 /main/php_variables.c
parent25c8f0975220c4761c3f94943fb5e7686873bc32 (diff)
downloadphp-git-e3b7f3fd0d3884a214c6fda97db14295a076171d.tar.gz
Unicode support: MS Visual C compatibility
Diffstat (limited to 'main/php_variables.c')
-rw-r--r--main/php_variables.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/main/php_variables.c b/main/php_variables.c
index 0555c23e9f..0d61ebc0b4 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -296,7 +296,8 @@ PHPAPI void php_u_register_variable_ex(UChar *var, zval *val, zval *track_vars_a
while (1) {
if (is_array) {
- UChar *escaped_index = NULL, *index_s;
+ zstr escaped_index = NULL_ZSTR;
+ UChar *index_s;
int32_t new_idx_len = 0;
ip++;
@@ -332,18 +333,18 @@ PHPAPI void php_u_register_variable_ex(UChar *var, zval *val, zval *track_vars_a
/* UTODO fix for magic_quotes_gpc case */
/* no need to addslashes() the index if it's the main variable name */
//escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC);
- escaped_index = index;
+ escaped_index.u = index;
} else {
- escaped_index = index;
+ escaped_index.u = index;
}
- if (zend_u_symtable_find(symtable1, IS_UNICODE, (zstr)escaped_index, index_len+1, (void **) &gpc_element_p)==FAILURE
+ if (zend_u_symtable_find(symtable1, IS_UNICODE, escaped_index, index_len+1, (void **) &gpc_element_p)==FAILURE
|| Z_TYPE_PP(gpc_element_p) != IS_ARRAY) {
MAKE_STD_ZVAL(gpc_element);
array_init(gpc_element);
- zend_u_symtable_update(symtable1, IS_UNICODE, (zstr)escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
+ zend_u_symtable_update(symtable1, IS_UNICODE, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
}
- if (index!=escaped_index) {
- efree(escaped_index);
+ if (index!=escaped_index.u) {
+ efree(escaped_index.u);
}
}
symtable1 = Z_ARRVAL_PP(gpc_element_p);
@@ -368,8 +369,10 @@ plain_var:
} else {
/* UTODO fix for php_addslashes case */
//char *escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC);
- UChar *escaped_index = index;
- zend_u_symtable_update(symtable1, IS_UNICODE, (zstr)escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
+ zstr escaped_index;
+
+ escaped_index.u = index;
+ zend_u_symtable_update(symtable1, IS_UNICODE, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
//efree(escaped_index);
}
break;