Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10376 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37005 invoked by uid 1010); 10 Jun 2004 10:38:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36957 invoked by uid 1007); 10 Jun 2004 10:38:19 -0000 To: internals@lists.php.net Date: Thu, 10 Jun 2004 13:37:57 +0300 References: <00f901c44e20$62cf0170$0a00a8c0@home.jevon.org> Organization: none Content-Type: text/plain; format=flowed; delsp=yes; charset=koi8-r MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: User-Agent: Opera M2/7.50 (Win32, build 3778) X-Posted-By: 217.23.116.150 Subject: Re: [PHP-DEV] stripslashes() improvements From: valyala@tut.by ("Alexander Valyalkin") On Thu, 10 Jun 2004 00:47:09 -0700 (PDT), Rasmus Lerdorf 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/