Re: quick addslashes bugfix
| From: | James L. Pine | Date: | Mon, 08 Oct 2001 20:48:09 +0000 |
| Subject: | Re: quick addslashes bugfix | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67568@lists.php.net to get a copy of this message | ||
so here's the deal with addslashes if magic_quotes_sybase is on...
I set up a sybase server and it looks like the nul char in character
fields is not an option. binary fields can take a nul, but field values
are dealt with as bin2hex'd strings, which takes care of nul escaping. so
it's equally as wrong to attempt to insert a character string containing
nul as it is to attempt to insert a character string containing a
backslash escaped nul. the backslash escaped version will go in as "\0"
and come out as "\0" but it's a case of garbage-in/garbage-out. (we may
as well replace nul with "character-fields-are-not-binary-safe"-- any
escape we choose is going to be php-specific and will have to be handled
on both store and retrieve... not really an option.)
I'd suggest that it's better behavior for php to not escape nuls, even in
the case of sybase-- we can either let the db functions return parse
errors, or we can do arbitrary replacement and have the db functions
execute without detectable error, but have them operate on what is
essentially corrupted data.
I don't believe that reverse compatibility is an issue, as this is a
non-reversible escape at the moment...
--jlp