note 54263 deleted from function.mysql-real-escape-string by nlopess
| From: | nlopess@php.net | Date: | Thu, 30 Jun 2005 09:21:24 +0000 |
| Subject: | note 54263 deleted from function.mysql-real-escape-string by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91192@lists.php.net to get a copy of this message | ||
Note Submitter:
----
I use this regexp to escape only unescaped characters
<?php
function mysql_escape_magic($q)
{
$ugly = "\\\\'\\\"\\\x1a";
return preg_replace("/\\\\?([$ugly])/", "\\\\$1", $q);
}
?>
it doesn't work on 0-bytes, though