php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51370 php_filter_int does not allow thousand separators
Submitted: 2010-03-23 18:55 UTC Modified: 2018-03-12 14:16 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mumu at seznam dot cz Assigned:
Status: Open Package: Filter related
PHP Version: 5.2.13 OS: N/A
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mumu at seznam dot cz
New email:
PHP Version: OS:

 

 [2010-03-23 18:55 UTC] mumu at seznam dot cz
Description:
------------
The php_filter_int function located in /[svn]/php/php-src/trunk/ext/filter/logical_filters.c does not allow thousand separators in the provided value to valide.

Most countries allows using of thousand separators, so if the function is not usable in validating user input.

Please provide support for thousand separators in the sense of FILTER_FLAG_ALLOW_THOUSAND flag for php_filter_float function and Request #51368. 

Test script:
---------------
var_dump(filter_var('1 000', FILTER_VALIDATE_INT, array('flags' => FILTER_FLAG_ALLOW_THOUSAND, 'options' => array('thousand' => ' '))));

Expected result:
----------------
int(1000)

Actual result:
--------------
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-12 14:16 UTC] cmb@php.net
-Package: Unknown/Other Function +Package: Filter related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Oct 23 03:01:29 2019 UTC