|  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
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.
Block user comment
Status: Assign to:
Bug Type:
From: web-php-bugs at sklar dot com
New email:
PHP Version: OS:


 [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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-23 04:31 UTC]
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
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the 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]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

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-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 01 14:01:29 2023 UTC