Re: stripslashes() improvements

From: Date: Thu, 10 Jun 2004 10:37:57 +0000
Subject: Re: stripslashes() improvements
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-10376@lists.php.net to get a copy of this message
On Thu, 10 Jun 2004 00:47:09 -0700 (PDT), Rasmus Lerdorf <rasmus@php.net> wrote:
Uh, what are you guys talking about? That test case is bogus. $s = 'c:\\windows\\system32'; This means that the base string we are working with is c:\windows\system32 here before any sort of stripslashes. If you then call stripslashes() on that, it will strip these slashes! That's exactly what the function is designed to do and what it is supposed to do. If your version does not strip these slashes, then it is not stripslashes(). stripslashes() strips all slashes, not just slashes before ', " and \ very much by design. I suppose it might be useful to have a version of stripslashes() which only strips slashes if they come before ', " or \ but this function wouldn't be stripslashes() and certainly shouldn't replace the existing stripslashes function because doing so would break all sorts of stuff. -Rasmus
I think it will be very useful to add optional parameter to stripslashes() to strip only slashes which have been added by addslashes() (before ", ', \ and NULL). -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

« previous php.internals (#10376) next »