mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed bug #33904 (input array keys being escaped when magic quotes is off).
This commit is contained in:
parent
f66d5f0cc5
commit
22db404132
2 changed files with 12 additions and 2 deletions
|
@ -183,7 +183,13 @@ plain_var:
|
|||
zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
|
||||
} else {
|
||||
zval **tmp;
|
||||
char *escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC);
|
||||
char *escaped_index;
|
||||
|
||||
if (PG(magic_quotes_gpc)) {
|
||||
escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC);
|
||||
} else {
|
||||
escaped_index = index;
|
||||
}
|
||||
/*
|
||||
* According to rfc2965, more specific paths are listed above the less specific ones.
|
||||
* If we encounter a duplicate cookie name, we should skip it, since it is not possible
|
||||
|
@ -196,7 +202,9 @@ plain_var:
|
|||
break;
|
||||
}
|
||||
zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
|
||||
efree(escaped_index);
|
||||
if (PG(magic_quotes_gpc)) {
|
||||
efree(escaped_index);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue