Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10374 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14015 invoked by uid 1010); 10 Jun 2004 09:35:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 13991 invoked by uid 1007); 10 Jun 2004 09:35:52 -0000 Message-ID: <20040610093552.13990.qmail@pb1.pair.com> To: internals@lists.php.net Date: Thu, 10 Jun 2004 06:35:44 -0300 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 References: <20040609150030.18f59a2c.tony2001@phpclub.net> <20040609155610.0425464f.tony2001@phpclub.net> <20040610115626.7984e4b5.tony2001@phpclub.net> In-Reply-To: <20040610115626.7984e4b5.tony2001@phpclub.net> X-Enigmail-Version: 0.83.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig02DCC31F85D2A470F3A609DF" X-Posted-By: 201.8.4.7 Subject: Re: [PHP-DEV] stripslashes() improvements From: accerqueira@superig.com.br (Andre Cerqueira) --------------enig02DCC31F85D2A470F3A609DF Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit The 2 first bugs where really bogus, but imho the last one did make sense. If stripslashes does "Un-quote string quoted with addslashes()", how addslashes would come up with: > c:\windows\system32 from: > c:windowssystem32 ? Maybe its to late for a change, now that most people are used to this behavior, but im still not convinced that it was really supposed to be this way (can anyone explain "why"?). I noticed 3 different thoughts: a) stripslashes() were meant to strip all slashes This confused me, probably i misinterpreted... Wouldnt it be like calling strtr($string, '\\', '')? b) stripslashes() were meant to strip all slashes but the ones followed by a slash (if any) This is how it works now Though it makes (stripslashes(addslashes(string)) == string) true, it doesnt make (addslashes(stripslashes(string)) == string) necessarily true. c) stripslashes() were meant to strip all slashes added by addslashes This is what the manual says. At bug #27848, iliaa gave a "proof why it works" assuming stripslashes will only be called after addslashes. That would make the third bug bogus, ok, but probably Alexander Valyalkin would be right also, and it wouldnt be a problem to do things his way. I probably dont know as much as anyone here, this is just what i understood. If im wrong, can someone explain where and why? Antony Dovgal wrote: > On Thu, 10 Jun 2004 10:50:09 +0300 > "Alexander Valyalkin" wrote: > > >>On Wed, 9 Jun 2004 15:56:10 +0400, Antony Dovgal >> wrote: >> >> >>>If you think it's wrong - prove it. >>>There are quite detailed reasons why those bugs were considered to >>>be bogus. >>> >>>I'm ok if you're going to improve stripslashes() efficiency and/or >>>to make it just faster, this could be very useful addon. But I doubt >>>it needs some kind of'fixing', 'cos it works ok ATM, as I know. > > >>Ok, my version of stripslashes() is faster, clearer, works correctly >>with old >>tests and solves mentioned bugs. Are you still doubt? Try to compare >>the old >>(current) code to new one. > > > Faster is ok, but you'd better read what Rasmus said. > And again, trying to fix BOGUS bugs you're going wrong way. > > --- > WBR, > Antony Dovgal aka tony2001 > tony2001@phpclub.net || antony@dovgal.com --------------enig02DCC31F85D2A470F3A609DF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAyCt2axdA/5C8vH8RAozZAJ9MADMVj/AZq0ktpwG8C56V8yGBgwCfWz+f GV6gCiRAduUFgXBnVIRb+Xk= =5lur -----END PGP SIGNATURE----- --------------enig02DCC31F85D2A470F3A609DF--