cvs: pear /Validate/Validate IS.php
| From: | Hannes Magnusson | Date: | Mon, 21 Nov 2005 21:56:22 +0000 |
| Subject: | cvs: pear /Validate/Validate IS.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-36438@lists.php.net to get a copy of this message | ||
bjori Mon Nov 21 16:56:22 2005 EDT
Modified files:
/pear/Validate/Validate IS.php
Log:
Performance fix & deleted unnecessary check for datafile
http://cvs.php.net/diff.php/pear/Validate/Validate/IS.php?r1=1.15&r2=1.16&ty=u
Index: pear/Validate/Validate/IS.php
diff -u pear/Validate/Validate/IS.php:1.15 pear/Validate/Validate/IS.php:1.16
--- pear/Validate/Validate/IS.php:1.15 Sat Nov 19 12:01:50 2005
+++ pear/Validate/Validate/IS.php Mon Nov 21 16:56:19 2005
@@ -23,7 +23,7 @@
* @author Hannes Magnússon <bjori@php.net>
* @copyright 1997-2005 Hannes Magnússon
* @license http://www.opensource.org/licenses/bsd-license.php
new BSD
- * @version CVS: $Id: IS.php,v 1.15 2005/11/19 17:01:50 bjori Exp $
+ * @version CVS: $Id: IS.php,v 1.16 2005/11/21 21:56:19 bjori Exp $
*/
/**
@@ -156,13 +156,9 @@
}
/* Same configuration as last time? No need to go further then */
if (count($postCodes) && $dataFile == $lastFile &&
- (($strong && $lastUrl == $url) || !$strong)) {
+ (!$strong || $lastUrl == $url)) {
return in_array($postCode, $postCodes);
}
- /* Sanity check the data file */
- if (!is_readable($dataFile)) {
- return false;
- }
/* Live check */
if ($strong) {
@@ -185,7 +181,7 @@
}
}
- if (!count($postCodes) && file_exists($dataFile)) {
+ if (!count($postCodes) && is_readable($dataFile)) {
$postCodes = file($dataFile);
$lastFile = $dataFile;
}