Skip to content

Commit f4a39b5

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #32802 (broken MFH)
1 parent 75a3ee0 commit f4a39b5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

main/php_variables.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,25 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_arra
182182
if (!index) {
183183
zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
184184
} else {
185+
zval **tmp;
186+
185187
if (PG(magic_quotes_gpc) && (index!=var)) {
186188
char *escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC);
189+
190+
if (PG(http_globals)[TRACK_VARS_COOKIE] && symtable1 == Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) &&
191+
zend_hash_find(symtable1, escaped_index, index_len+1, (void **) &tmp) != FAILURE) {
192+
efree(escaped_index);
193+
break;
194+
}
195+
187196
zend_hash_update(symtable1, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
188197
efree(escaped_index);
189198
} else {
199+
if (PG(http_globals)[TRACK_VARS_COOKIE] && symtable1 == Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) &&
200+
zend_hash_find(symtable1, index, index_len+1, (void **) &tmp) != FAILURE) {
201+
break;
202+
}
203+
190204
zend_hash_update(symtable1, index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
191205
}
192206
}

0 commit comments

Comments
 (0)