cvs: pear /Validate/Validate AT.php
| From: | Michael Wallner | Date: | Wed, 10 Dec 2003 16:22:57 +0000 |
| Subject: | cvs: pear /Validate/Validate AT.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-14768@lists.php.net to get a copy of this message | ||
mike Wed Dec 10 11:22:57 2003 EDT
Modified files:
/pear/Validate/Validate AT.php
Log:
stripped some whitespace
Index: pear/Validate/Validate/AT.php
diff -u pear/Validate/Validate/AT.php:1.3 pear/Validate/Validate/AT.php:1.4
--- pear/Validate/Validate/AT.php:1.3 Wed Dec 10 11:19:25 2003
+++ pear/Validate/Validate/AT.php Wed Dec 10 11:22:56 2003
@@ -15,7 +15,7 @@
// | Copyright (c) 2003 Michael Wallner <mike@iworks.at> |
// +----------------------------------------------------------------------+
//
-// $Id: AT.php,v 1.3 2003/12/10 16:19:25 mike Exp $
+// $Id: AT.php,v 1.4 2003/12/10 16:22:56 mike Exp $
/**
* Requires Validate
@@ -29,7 +29,7 @@
* @package Validate
* @category PHP
*
-* @version $Revision: 1.3 $
+* @version $Revision: 1.4 $
* @access public
*/
class Validate_AT
@@ -47,7 +47,7 @@
function postcode($zip)
{
static $postcodes;
-
+
if (!isset($postcodes)) {
$file = '@DATADIR@/Validate/AT_postcodes.txt';
$postcodes = array_map('trim', file($file));
@@ -77,27 +77,27 @@
if (!$matched) {
return false;
}
-
+
list(, $num, $chk, $d, $m, $y) = $matches;
if (!Validate::date("$d-$m-$y", array('format' =>
'%d-%m-%y'))) {
return false;
}
-
+
$str = (string) $num . $chk . $d . $m . $y;
$len = strlen($str);
$fkt = '3790584216';
$sum = 0;
-
+
for ($i = 0; $i < $len; $i++) {
$sum += $str{$i} * $fkt{$i};
}
-
+
$sum = $sum % 11;
if ($sum == 10) {
$sum = 0;
}
-
+
return ($sum == $chk);
}
}