Bug #14935 Updated: spaces NOT escaped by A..z

From: Date: Sat, 12 Jan 2002 23:35:17 +0000
Subject: Bug #14935 Updated: spaces NOT escaped by A..z
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-76825@lists.php.net to get a copy of this message
ID: 14935 Updated by: irc-html Reported By: addcslashes@example.com Old Status: Open Status: Closed Bug Type: Documentation problem PHP Version: 4.1.1 New Comment: Ok, fixed in CVS (again). Current example (in CVS) reads: echo addcslashes('foo[ ]', 'A..z'); // output: \f\o\o\[ \] // All upper and lower-case letters will be escaped // ... but so will the [\]^_` and any tabs, line // feeds, carriage returns, etc. Status -> Closed (again) Previous Comments: ------------------------------------------------------------------------ [2002-01-10 19:00:06] elixer@php.net The problem is that "space characters" in the example code is not meant to refer to specifically a space (ASCII 32) it is referring to tab, vertical tab, carriage return, line feed, etc. Basically all of the [:space:] characters except for an actual ASCII 32 space. This is expected behavior, you don't have to escape ASCII 32 in C strings. The documentation fix is still lacking. The line in the example code should read: // All upper and lower-case letters will be escaped // ... but so will the [\]^_` and any tabs, line // feeds, carriage returns, etc. Instead of the current (CVS): // All upper and lower-case letters will be escaped // ... but so will the [\]^_` Or something along those lines. I'll commit that later tonight unless someone objects or has better verbage. ------------------------------------------------------------------------ [2002-01-10 02:06:55] zak@php.net We should probably take a closer look at this problem. I verified that addcslashes had the currently documented behaviour a while ago. If it has changed, we have a problem. ------------------------------------------------------------------------ [2002-01-09 21:09:38] irc-html@php.net Confirmed, will fix in CVS. Status -> Closed ------------------------------------------------------------------------ [2002-01-08 15:24:48] addcslashes@example.com http://www.php.net/manual/en/function.addcslashes.php says `and space characters' but this is not true; on my system addcslashes('foo[ ]','A..z') results in \f\o\o\[ \] not \f\o\o\[\ \] ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14935&edit=1

« previous php.dev (#76825) next »