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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-12 14:16 UTC] cmb@php.net
-Package: Unknown/Other Function +Package: Filter related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 03 05:01:28 2024 UTC