ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-dev
php-dev
#44956 [NEW]: stripslashes() removes slashes not added by addslashes()
by Webmaster At Drk Dot Com Dot Ar other posts by this author
May 9 2008 8:44AM messages near this date
#44957 [Opn->Bgs]: Scripting stops after calling a magic setter from a static function | #44956 [Com]: stripslashes() removes slashes not added by addslashes()
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
Thread:
Webmaster At Drk Dot Com Dot Ar
C Dot Onogol At Gmail Dot Com
C Dot Onogol At Gmail Dot Com

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved