|  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
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-03-23 18:55 UTC] mumu at seznam dot cz
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:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-12 14:16 UTC]
-Package: Unknown/Other Function +Package: Filter related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 08:01:28 2024 UTC