diff options
Diffstat (limited to 'system/helpers/valid.php')
-rw-r--r-- | system/helpers/valid.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/system/helpers/valid.php b/system/helpers/valid.php index 610076f3..8a3583b2 100644 --- a/system/helpers/valid.php +++ b/system/helpers/valid.php @@ -2,7 +2,7 @@ /** * Validation helper class. * - * $Id: valid.php 4187 2009-04-08 04:01:23Z zombor $ + * $Id: valid.php 4367 2009-05-27 21:23:57Z samsoir $ * * @package Core * @author Kohana Team @@ -161,13 +161,13 @@ class valid_Core { for ($i = $length - 1; $i >= 0; $i -= 2) { // Add up every 2nd digit, starting from the right - $checksum += substr($number, $i, 1); + $checksum += $number[$i]; } for ($i = $length - 2; $i >= 0; $i -= 2) { // Add up every 2nd digit doubled, starting from the right - $double = substr($number, $i, 1) * 2; + $double = $number[$i] * 2; // Subtract 9 from the double where value is greater than 10 $checksum += ($double >= 10) ? $double - 9 : $double; |