cvs: pear /Validate Validate.php

From: Date: Wed, 29 May 2002 11:05:48 +0000
Subject: cvs: pear /Validate Validate.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4256@lists.php.net to get a copy of this message
cox Wed May 29 07:05:48 2002 EDT Modified files: /pear/Validate Validate.php Log: Allow spaces between sign in the number check regex (thanks Pierre) Index: pear/Validate/Validate.php diff -u pear/Validate/Validate.php:1.7 pear/Validate/Validate.php:1.8 --- pear/Validate/Validate.php:1.7 Wed May 29 06:09:09 2002 +++ pear/Validate/Validate.php Wed May 29 07:05:48 2002 @@ -24,7 +24,7 @@ { $dec_prec = $dec_prec ? "{1,$dec_prec}" : '+'; $dec_regex = $decimal ? "[$decimal][0-9]$dec_prec" : ''; - if (!preg_match("|^[-+]?[0-9]+($dec_regex)?\$|", $number)) { + if (!preg_match("|^[-+]?\s*[0-9]+($dec_regex)?\$|", $number)) { return false; } if ($decimal != '.') {

« previous php.pear.cvs (#4256) next »