Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Andre Cerqueira
Thanks for replying Understood, but do you agree with me that the manual have a better chance to give a wrong idea than the right one on this? And that is giving me second thoughts about how bad it would be to change stripslashes. I think the manual could imply 2 things: a) stripslashes should o

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Rasmus Lerdorf
On Thu, 10 Jun 2004, Andre Cerqueira wrote: > > But the manual doesn't say that it *only* removes slashes > > added by addslashes. > > "Returns a string with backslashes stripped off. (\' becomes ' and so > on.) Double backslashes (\\) are made into a single backslash (\)." > > Yes, it doesn'

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Andre Cerqueira
> But the manual doesn't say that it *only* removes slashes > added by addslashes. "Returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\\) are made into a single backslash (\)." Yes, it doesn't *say*, but i think anyone could see that implied if one did

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Rasmus Lerdorf
On Thu, 10 Jun 2004, Stefan Esser wrote: > this is not directly releated. I looked into addslashes yesterday and > thought that it would be much better to scan the string 2 times. The > first time to find out how much extra bytes one needs, and the second > time to do the actual replacing. So we

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Stefan Esser
Hi, this is not directly releated. I looked into addslashes yesterday and thought that it would be much better to scan the string 2 times. The first time to find out how much extra bytes one needs, and the second time to do the actual replacing. So we do not need to allocate and oversized block

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Rasmus Lerdorf
On Thu, 10 Jun 2004, Andre Cerqueira wrote: > 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 It can't! Ho

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Derick Rethans
On Thu, 10 Jun 2004, Alexander Valyalkin wrote: > On Thu, 10 Jun 2004 11:56:26 +0400, Antony Dovgal <[EMAIL PROTECTED]> > wrote: > > >> Ok, my version of stripslashes() is faster, clearer, works correctly > >> with old > >> tests and solves mentioned bugs. Are you still doubt? Try to compare > >>

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Alexander Valyalkin
On Thu, 10 Jun 2004 11:56:26 +0400, Antony Dovgal <[EMAIL PROTECTED]> wrote: 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

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Alexander Valyalkin
On Wed, 9 Jun 2004 14:20:01 +0200, Moshe Doron <[EMAIL PROTECTED]> wrote: in addition, i want to remind that when magic mode is on, this function been used by each script to manipulate the $_REQUEST vars so playing with this peace of code have 1. big codes breaking potential. 2. big security p

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Alexander Valyalkin
On Thu, 10 Jun 2004 00:47:09 -0700 (PDT), Rasmus Lerdorf <[EMAIL PROTECTED]> 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

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Andre Cerqueira
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 b

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Antony Dovgal
On Thu, 10 Jun 2004 10:50:09 +0300 "Alexander Valyalkin" <[EMAIL PROTECTED]> wrote: > On Wed, 9 Jun 2004 15:56:10 +0400, Antony Dovgal > <[EMAIL PROTECTED]> wrote: > > > If you think it's wrong - prove it. > > There are quite detailed reasons why those bugs were considered to > > be bogus. > > >

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Alexander Valyalkin
On Wed, 9 Jun 2004 15:56:10 +0400, Antony Dovgal <[EMAIL PROTECTED]> 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 ve

Re: [PHP-DEV] stripslashes() improvements

2004-06-10 Thread Rasmus Lerdorf
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

Re: [PHP-DEV] stripslashes() improvements

2004-06-09 Thread Alexander Valyalkin
On Thu, 10 Jun 2004 00:50:46 +1200, Jevon Wright <[EMAIL PROTECTED]> wrote: 'c:\\windows\\system32' becomes 'c:\windows\system32' in memory (the slashes are stripped). I know it :) stripslashes() will make it 'c:windowssystem32'. Thus the above tests will fail. Yes. The current version of stri

Re: [PHP-DEV] stripslashes() improvements

2004-06-09 Thread Jevon Wright
which affects GPC data?) Jevon - Original Message ----- From: "Alexander Valyalkin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 09, 2004 10:52 PM Subject: Re: [PHP-DEV] stripslashes() improvements > On Tue, 8 Jun 2004 16:03:19 +0200 (CEST), De

Re: [PHP-DEV] stripslashes() improvements

2004-06-09 Thread Antony Dovgal
On Wed, 09 Jun 2004 14:17:33 +0300 "Alexander Valyalkin" <[EMAIL PROTECTED]> wrote: > On Wed, 9 Jun 2004 15:00:30 +0400, Antony Dovgal > <[EMAIL PROTECTED]> wrote: > > > On Wed, 09 Jun 2004 13:52:42 +0300 > > "Alexander Valyalkin" <[EMAIL PROTECTED]> wrote: > > > >> On Tue, 8 Jun 2004 16:03:19 +

Re: [PHP-DEV] stripslashes() improvements

2004-06-09 Thread moshe doron
> > Ok. First of all, my version of the stripslashes() solves following > > bugs: > > #9437 > > #19947 > > #27848 > > All these bugs were marked as 'bogus' (yeah, the first one is bogus too, > dunno why it's 'closed'). > So, personally I can't understand what are you trying to fix, if nothing > is

Re: [PHP-DEV] stripslashes() improvements

2004-06-09 Thread Alexander Valyalkin
On Wed, 9 Jun 2004 15:00:30 +0400, Antony Dovgal <[EMAIL PROTECTED]> wrote: On Wed, 09 Jun 2004 13:52:42 +0300 "Alexander Valyalkin" <[EMAIL PROTECTED]> wrote: On Tue, 8 Jun 2004 16:03:19 +0200 (CEST), Derick Rethans <[EMAIL PROTECTED]> wrote: Ok. First of all, my version of the stripslashes()

Re: [PHP-DEV] stripslashes() improvements

2004-06-09 Thread Antony Dovgal
On Wed, 09 Jun 2004 13:52:42 +0300 "Alexander Valyalkin" <[EMAIL PROTECTED]> wrote: > On Tue, 8 Jun 2004 16:03:19 +0200 (CEST), Derick Rethans > <[EMAIL PROTECTED]> wrote: > Ok. First of all, my version of the stripslashes() solves following > bugs: > #9437 > #19947 > #27848 All these bugs were

Re: [PHP-DEV] stripslashes() improvements

2004-06-09 Thread Alexander Valyalkin
On Tue, 8 Jun 2004 16:03:19 +0200 (CEST), Derick Rethans <[EMAIL PROTECTED]> wrote: You'll have to proof that by writing testcases, for example try it with the test cases in the current source and write new ones for things that we don't have a test case for yet. -PHPAPI void php_stripslashes(cha

Re: [PHP-DEV] stripslashes() improvements

2004-06-08 Thread Derick Rethans
On Tue, 8 Jun 2004, Alexander Valyalkin wrote: > Today I checked stripslashes() function. > My version of the function if faster, more clearer and bugs free (I hope > :)) You'll have to proof that by writing testcases, for example try it with the test cases in the current source and write new one

[PHP-DEV] stripslashes() improvements

2004-06-08 Thread Alexander Valyalkin
Today I checked stripslashes() function. My version of the function if faster, more clearer and bugs free (I hope :)) Below you can see the source and unified diff: source= PHPAPI void php_stripslashes(char *str, size_t *len TSRMLS_DC) { char *s, *t; size_t l;