|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-02-26 05:37 UTC] michielu at gimo dot dhs dot org
[2002-02-26 05:41 UTC] sander@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 08:00:02 2025 UTC |
I've added verbose reports in case this report is influences by addslashes as well. the following simple test: <?php echo addslashes("' \' \\' \\\'\n"); echo stripslashes(addslashes("' \' \\' \\\'\n")); ?> (i.e.: quote, slash quote, double slash quote, triple slash quote) is expected to yield (escape each slash and each quote): \' \\\' \\\\\' \\\\\\\' ' \' \\' \\\' (ie addslashes should yield slash quote, triple slash quote, five times slash quote, seven times slash quote, stripslashes should yield quote, slash quote, double slash quote, triple slash quote). Instead, addslashes does not appear to quote properly and this is what I get: \' \\\' \\\' \\\\\' ' \' \' \\' (addslashes: slash quote, triple slash quote, triple slash quote, five times slash quote. stripslashes on this output: quote, slash quote, slash quote, double slash quote). Obviously, this makes addslashes kind-of useless if you get escaped input. Yes, my database queries will not fail and that would be the primary use of addslashes. It appears that the escaped quote of the second and third combination (double slash quote and triple slash quote) is not translated to the expected triple slash quote (i.e. an escaped slash plus an escaped quote). Here's the configure line if it is of any use: './configure' '--with-apache=../apache' '--with-mysql=/usr' '--with-openssl' '--with-zlib' '--enable-debug=no' '--enable-safe-mode=no' '--enable-discard-path=no' '--with-gd' '--with-ttf' '--enable-gd-imgstrttf' '--enable-gd-native-ttf' '--with-png-dir=/usr/lib' '--with-jpeg-dir=/usr/lib' '--enable-magic-quotes' '--enable-ftp' '--enable-memory-limit' and I disabled magic_quotes_gpc in a local .htaccess