From: webmaster at drk dot com dot ar Operating system: Linux PHP version: 5.2.6 PHP Bug Type: Scripting Engine problem Bug description: stripslashes() removes slashes not added by addslashes()
Description: ------------ stripslashes() removes slashes not added by addslashes() I expect a function to do what is described in the first line of its documentation. As published in this site "un-quotes strings quoted with addslashes()" It is water clear this functions isn't working as expected. As it shouldn't remove any slash that addslashes() wouldn't add. In example, a slash before a space won't be added by addslashes() and mustn't be removed by stripslashes() You can refuse to correct the code. In that case, which I consider most useless, you ought to correct the documentation. I ask myself won't be useful a function which undoes what addslashes() does? Reproduce code: --------------- <? $str = "the first \ should stay. it\'s the \"right\" case"; $str = stripslashes($str); var_dump($str); ?> Expected result: ---------------- "the first \ should stay. it's the "right" case" Actual result: -------------- "the first should stay. it's the "right" case" -- Edit bug report at http://bugs.php.net/?id=44956&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44956&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44956&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44956&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44956&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44956&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44956&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44956&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44956&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44956&r=support Expected behavior: http://bugs.php.net/fix.php?id=44956&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44956&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44956&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44956&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44956&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44956&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44956&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44956&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44956&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44956&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44956&r=mysqlcfg