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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Sat May 25 20:01:27 2019 UTC