From:             todd at magnifisites dot com
Operating system: RH Linux/Windows XP
PHP version:      4.3.6
PHP Bug Type:     Documentation problem
Bug description:  addcslashes ASCII character conversion octal range invalid

Description:
------------
The addcslashes manual page states that characters with ASCII code lower
than 32 and higher than 126 are converted to octal representation.  It
then instructs us to use the ord() function to find the ASCII value for a
character.  I have found discrepancies in my tests (I've tested on both
Linux and Windows servers).  The octal representation conversion seems to
occur completely throughout the range including 32 through 126, inclusive,
rather than outside that range.

Reproduce code:
---------------
$null = NULL;
$var = "Hi there\" dollar $ amper \t sand & and single ' quote NULL
$null";
$escaped_var = addcslashes($var, "\0\9\34\36\38\39");
print $escaped_var;


Expected result:
----------------
Hi there\" dollar \$ amper \t sand \& and single \' quote NULL


Actual result:
--------------
Hi there" dollar $ amper sand & and single ' quote NULL

-- 
Edit bug report at http://bugs.php.net/?id=28683&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28683&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28683&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28683&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28683&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28683&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28683&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28683&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28683&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28683&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28683&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28683&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28683&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28683&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28683&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28683&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28683&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28683&r=float

Reply via email to