php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23762 QuickForm "nonzero" validation regex is wrong
Submitted: 2003-05-22 16:20 UTC Modified: 2003-05-28 11:25 UTC
From: web-php-bugs at sklar dot com Assigned: mansion (profile)
Status: Not a bug Package: PEAR related
PHP Version: 5CVS-2003-05-22 (dev) OS: Linux
Private report: No CVE-ID: None
 [2003-05-22 16:20 UTC] web-php-bugs at sklar dot com
The "nonzero" validation rule in QuickForm.php matches input to the regex "^[1-9][0-9]+". This only allows positive numbers >= 10. It should be "^[1-9][0-9]*" to allow positive numbers starting with 1. For that matter, it should be "^-?[1-9][0-9]*" to allow negative numbers, too.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-23 04:31 UTC] mansion@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2003-05-28 11:25 UTC] mansion@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The nonzero rule is used to check if the number starts with a zero as stated in the upcoming documentation. To preserve BC, I have reverted the last patch. Maybe nonzero is unclear (but with documentation, it will be clearer).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC