From: pmjones88 at gmail dot com Operating system: Mac OS X PHP version: 5.2.0 PHP Bug Type: Filter related Bug description: FILTER_SANITIZE_NUMBER_FLOAT incorrect when multiple dots in value
Description: ------------ When using FILTER_SANITIZE_NUMBER_FLOAT with FILTER_FLAG_ALLOW_FRACTION, it seems to allow any number of decimal points, not just a single decimal point. This results in an invalid value being reported as sanitized. Reproduce code: --------------- <?php $val = 'abc ... 123.45 ,.../'; $san = filter_var($val, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); var_dump($san); ?> Expected result: ---------------- float 123.45 Actual result: -------------- string(12) "...123.45..." -- Edit bug report at http://bugs.php.net/?id=40156&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40156&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40156&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40156&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40156&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40156&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40156&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40156&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40156&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40156&r=support Expected behavior: http://bugs.php.net/fix.php?id=40156&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40156&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40156&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40156&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40156&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40156&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40156&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40156&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40156&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40156&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40156&r=mysqlcfg