#38785 [NEW]: stripslashes is setlocale aware - decimal point conversion

From: Date: Mon, 11 Sep 2006 23:35:51 +0000
Subject: #38785 [NEW]: stripslashes is setlocale aware - decimal point conversion
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969374000@lists.php.net to get a copy of this message
From: m dot kurzyna at crystalpoint dot pl Operating system: Linux PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: stripslashes is setlocale aware - decimal point conversion Description: ------------ Stripslashes seems to be locale specific. It changes decimal point character when used in enviroment with locales set. I'm not shure is this a feature or a bug but it's something unexpected as it's not mensioned in the manual as far as I know. And it's easy to criple database input with this. As a locale to observe this behaviour one can set probably enything that uses comma rather then dot for decimal point. Reproduce code: --------------- $float = 0.10; // $float is now float 0.10 setlocale(LC_ALL,'C'); $r = stripslashes($float); // $r is now string "0.10" setlocale(LC_ALL,'pl_PL'); $r = stripslashes($float); // $r is now string "0,10" Expected result: ---------------- No change in decimalpoint or explicit note in documentation. Actual result: -------------- Provided in code example - change of decimal point character. -- Edit bug report at http://bugs.php.net/?id=38785&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38785&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38785&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38785&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38785&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38785&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38785&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38785&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38785&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38785&r=support Expected behavior: http://bugs.php.net/fix.php?id=38785&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38785&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38785&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38785&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38785&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38785&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38785&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38785&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38785&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38785&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38785&r=mysqlcfg

« previous php.doc (#969374000) next »