cvs: pear /Validate/Validate AT.php

From: Date: Wed, 30 Aug 2006 09:35:30 +0000
Subject: cvs: pear /Validate/Validate AT.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-41917@lists.php.net to get a copy of this message
badams Wed Aug 30 09:35:30 2006 UTC Modified files: /pear/Validate/Validate AT.php Log: - Optimized Region http://cvs.php.net/viewvc.cgi/pear/Validate/Validate/AT.php?r1=1.20&r2=1.21&diff_format=u Index: pear/Validate/Validate/AT.php diff -u pear/Validate/Validate/AT.php:1.20 pear/Validate/Validate/AT.php:1.21 --- pear/Validate/Validate/AT.php:1.20 Sun Aug 27 04:11:48 2006 +++ pear/Validate/Validate/AT.php Wed Aug 30 09:35:30 2006 @@ -25,7 +25,7 @@ * @copyright 1997-2005 Michael Wallner * @copyright (c) 2006 Byron Adams * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: AT.php,v 1.20 2006/08/27 04:11:48 badams Exp $ + * @version CVS: $Id: AT.php,v 1.21 2006/08/30 09:35:30 badams Exp $ * @link http://pear.php.net/package/Validate_AT */ @@ -113,11 +113,12 @@ */ function region($region) { - $region = str_replace( - array("AU","-"," "), - "", - strtoupper($region)); - - return ($region > 0 && $region < 10); - } + $region = str_ireplace("AU","",$region); + + if (!ctype_digit($region)) { + return false; + } + + return ($region > 0 && $region < 10); + } }

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