#22904 [Csd->Opn]: sybase_magic_quotes does stuff with '\0' string

From: Date: Tue, 01 Apr 2003 13:24:16 +0000
Subject: #22904 [Csd->Opn]: sybase_magic_quotes does stuff with '\0' string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-36913@lists.php.net to get a copy of this message
ID: 22904 Updated by: momo@php.net Reported By: momo@php.net -Status: Closed +Status: Open Bug Type: Sybase-ct (ctlib) related Operating System: linux RH7.2 PHP Version: 4.3.2RC1 Assigned To: nomo New Comment: i revert the fix, coz some unexpected effects. i'll try later. Previous Comments: ------------------------------------------------------------------------ [2003-03-31 06:31:00] momo@php.net 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. ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ 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

« previous php.bugs (#36913) next »