#23762 [Csd->Bgs]: QuickForm "nonzero" validation regex is wrong

From: Date: Wed, 28 May 2003 16:25:43 +0000
Subject: #23762 [Csd->Bgs]: QuickForm "nonzero" validation regex is wrong
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16782@lists.php.net to get a copy of this message
ID: 23762 Updated by: mansion@php.net Reported By: web-php-bugs at sklar dot com -Status: Closed +Status: Bogus Bug Type: PEAR related Operating System: Linux PHP Version: 5CVS-2003-05-22 (dev) Assigned To: mansion New Comment: 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). Previous Comments: ------------------------------------------------------------------------ [2003-05-23 04:31:06] 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-22 16:20:47] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23762&edit=1

« previous php.pear.dev (#16782) next »