Re: magic_quotes_gpc behaviour
| From: | Arpad Ray | Date: | Mon, 09 Apr 2007 13:41:12 +0000 |
| Subject: | Re: magic_quotes_gpc behaviour | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-28722@lists.php.net to get a copy of this message | ||
Arpad Ray wrote:
So, is this behaviour deliberate, and if so, what's the rationale?The problem seems to be in (5.2.x CVS) php_variables.c, lines 161-166:
if (PG(magic_quotes_gpc) && (index != var)) {
/* 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);
} else {
escaped_index = index;
}
If "&& (index != var)" is removed, all keys are escaped as expected. The equivalent line for keys of scalar variables (198) lacks this check since 5.0.0, and since then it has escaped them correctly. It's still there in the 4.4 branch.
Is there any reason not to remove this check, at least in the 5.2 branch?
Arpad