#22904 [Opn->Asn]: sybase_magic_quotes does stuff with '\0' string
| From: | momo@php.net | Date: | Mon, 31 Mar 2003 12:31:00 +0000 |
| Subject: | #22904 [Opn->Asn]: sybase_magic_quotes does stuff with '\0' string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-36805@lists.php.net to get a copy of this message | ||
ID: 22904
Updated by: momo@php.net
Reported By: momo@php.net
-Status: Open
+Status: Assigned
Bug Type: Sybase-ct (ctlib) related
Operating System: linux RH7.2
PHP Version: 4.3.2RC1
-Assigned To:
+Assigned To: nomo
New Comment:
if the stripslashes have to recover the string as it was before
addslashes'ing so it fails.
all this code looks to me too disordered. for example, into the sybase
stripslashes there is the code:
----
if (*t == '\'') {
if ((l > 0) && (t[1] == '\'')) {
t++;
if (len != NULL) {
(*len)--;
}
l--;
}
*s++ = *t++;
---
but this code have nothing with slashes at all!
i'll try to learn the subject when i'll find some time for it and do
some order.
Previous Comments:
------------------------------------------------------------------------
[2003-03-27 09:06:47] iliaa@php.net
Is this even a bug? It seems to me the code follows the 'proper'
behaviour for sybase_magic_quotes, no?
------------------------------------------------------------------------
[2003-03-27 03:48:52] wez@php.net
Nothing to do with fwrite
------------------------------------------------------------------------
[2003-03-27 03:06:28] momo@php.net
ok, problem here is that php_stripslashes for sybase_magic_quetes
replace '\0' with ascii(0) due reverse action on php_addslashes.
IMHO in contrary to '\'' type replacements where we "maintains" the
data "queues fixed" all over the script, on ascii(0) data, we have no
problem do it onto the query level.
there'll be minore bc problem but the current beavior is totally bogus!
------------------------------------------------------------------------
[2003-03-26 10:31:27] momo@php.net
well, using set_magic_quotes_runtime(0); fix the problem.
due to my quick debug, the problem is somewhere into php_stripslashes
called on file.c:1543 i'll try to look into it on friday if this bug
still 'll be exists.
------------------------------------------------------------------------
[2003-03-26 10:18:30] momo@php.net
problem still exists on last cvs.
my editor show ascii(0) as ? but '\0' have to be showen as '\0'
mean, if the orginal text (c code this case) file included the \0
*string* i does't want fwrite() replace it with ascii(0)! but to save
it as the orginal string.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/22904
--
Edit this bug report at http://bugs.php.net/?id=22904&edit=1