note 69584 deleted from function.stripslashes by colder

From: Date: Tue, 12 Sep 2006 10:00:26 +0000
Subject: note 69584 deleted from function.stripslashes by colder
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-117047@lists.php.net to get a copy of this message
Note Submitter: m dot kurzyna at crystalpoint dot pl ---- Be aware! stripslashes seems to be locale specific. I've run into this on standard variable checks in an application which uses setlocale(). Consider following code: <?php $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" ?> Note the change in decimal point character! This is tested on PHP 5.1.6. For this to work you need to have used locales installed in test enviroment. Insted of 'pl_PL' you can probably use any locale that uses non dot decimal point character. 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 so I'm going to submit a bug report on this.

« previous php.notes (#117047) next »