cvs: pear /Validate package.xml /Validate/Validate FR.php UK.php US.php /Validate/Validate/Finance IBAN.php

From: Date: Tue, 16 Mar 2004 22:42:59 +0000
Subject: cvs: pear /Validate package.xml /Validate/Validate FR.php UK.php US.php /Validate/Validate/Finance IBAN.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-17470@lists.php.net to get a copy of this message
pajoye Tue Mar 16 17:42:59 2004 EDT Modified files: /pear/Validate package.xml /pear/Validate/Validate FR.php UK.php US.php /pear/Validate/Validate/Finance IBAN.php Log: - CS - prepare 0.4.0

http://cvs.php.net/diff.php/pear/Validate/package.xml?r1=1.21&r2=1.22&ty=u Index: pear/Validate/package.xml diff -u pear/Validate/package.xml:1.21 pear/Validate/package.xml:1.22 --- pear/Validate/package.xml:1.21 Tue Feb 3 18:40:22 2004 +++ pear/Validate/package.xml Tue Mar 16 17:42:57 2004 @@ -53,19 +53,15 @@ </maintainer> </maintainers> <release> - <version>0.3.0</version> + <version>0.4.0</version> <state>alpha</state> - <date>2003-12-05</date> - <notes>- Added Finance Validations for Financial related datas - (S. Neufeind, Piotr Klaban) -- Add polish validation (Piotr Klaban) -- Add German validation (Stefan Neufeind) -- Add EAN-UCC validtatio (see http://www.ean-ucc.org) (Piotr Klaban) -- Add International Standard Serial Number (ISSN) - and Music Number(ISMN) (Piotr Klaban, David Grant) -- Drop Validate::url() in preferenc of Validate::uri() which is fully - RFC2396 compliant -- Move to PHP 3.0 license + <date>2004-03-16</date> + <notes>- pt_BR moved to ptBR required for multiple support(BC break) +- Add CH validation (Switzerland) +- added Euro banknotes IDs +- Improved UK postcodes validation +- Fixed allowed_scheme options in Validate::uri() (Torsten Roehr) +- Fixed optional arguments in Validate::number() (Torsten Roehr) </notes> <filelist> <dir name="/"> @@ -113,6 +109,23 @@ </release> <changelog> <release> + <version>0.3.0</version> + <state>alpha</state> + <date>2003-12-05</date> + <notes>- Added Finance Validations for Financial related datas + (S. Neufeind, Piotr Klaban) +- Add polish validation (Piotr Klaban) +- Add German validation (Stefan Neufeind) +- Add EAN-UCC validtatio (see http://www.ean-ucc.org) (Piotr Klaban) +- Add International Standard Serial Number (ISSN) + and Music Number(ISMN) (Piotr Klaban, David Grant) +- Drop Validate::url() in preferenc of Validate::uri() which is fully + RFC2396 compliant +- Move to PHP 3.0 license + </notes> + </release> + + <release> <version>0.2.0</version> <state>alpha</state> <date>2003-06-15</date> http://cvs.php.net/diff.php/pear/Validate/Validate/FR.php?r1=1.9&r2=1.10&ty=u Index: pear/Validate/Validate/FR.php diff -u pear/Validate/Validate/FR.php:1.9 pear/Validate/Validate/FR.php:1.10 --- pear/Validate/Validate/FR.php:1.9 Wed Dec 10 10:07:34 2003 +++ pear/Validate/Validate/FR.php Tue Mar 16 17:42:58 2004 @@ -16,7 +16,7 @@ // | Authors: Pierre-Alain Joye <paj@pearfr.org> | // +----------------------------------------------------------------------+ // -// $Id: FR.php,v 1.9 2003/12/10 15:07:34 pajoye Exp $ +// $Id: FR.php,v 1.10 2004/03/16 22:42:58 pajoye Exp $ // // Specific validation methods for data used in France @@ -89,13 +89,6 @@ /** * Validate a french RIB * - * TO DO : - * strong validation against the INSEE cities databases (rpc or local DB) - * - * This function checks given number according the specs - * available here: - * http://www.dads.cnav.fr/tds/Stru0103.htm - * * @param string $aCodeBanque number or an array containaing the 'number'=>1234 * @param string $aCodeGuichet number or an array containaing the 'number'=>1234 * @param string $aNoCompte number or an array containaing the 'number'=>1234 @@ -118,7 +111,6 @@ $officecode = preg_replace('/[^0-9]/', '', $codeguichet); $account = preg_replace($chars, $values, $nocompte); - if (strlen($codebank) != 5){ return false; } http://cvs.php.net/diff.php/pear/Validate/Validate/UK.php?r1=1.10&r2=1.11&ty=u Index: pear/Validate/Validate/UK.php diff -u pear/Validate/Validate/UK.php:1.10 pear/Validate/Validate/UK.php:1.11 --- pear/Validate/Validate/UK.php:1.10 Mon Mar 8 15:11:57 2004 +++ pear/Validate/Validate/UK.php Tue Mar 16 17:42:58 2004 @@ -17,7 +17,7 @@ // | Stefan Neufeind <pear.neufeind@speedpartner.de> | // +----------------------------------------------------------------------+ // -// $Id: UK.php,v 1.10 2004/03/08 20:11:57 neufeind Exp $ +// $Id: UK.php,v 1.11 2004/03/16 22:42:58 pajoye Exp $ // // Specific validation methods for data used in UK @@ -131,7 +131,7 @@ // just checking to see if it is 6-8 digits // *THIS IS PROBABLY WRONG!!! RESEARCH* $preg = "/[0-9]{6,8}/"; - $match = (preg_match($preg, $sc))? true : false; + $match = (preg_match($preg, $ac))? true : false; return $match; } http://cvs.php.net/diff.php/pear/Validate/Validate/US.php?r1=1.10&r2=1.11&ty=u Index: pear/Validate/Validate/US.php diff -u pear/Validate/Validate/US.php:1.10 pear/Validate/Validate/US.php:1.11 --- pear/Validate/Validate/US.php:1.10 Wed Dec 10 10:07:34 2003 +++ pear/Validate/Validate/US.php Tue Mar 16 17:42:58 2004 @@ -17,7 +17,7 @@ // | Tim Gallagher <timg@sunflowerroad.com> | // +----------------------------------------------------------------------+ // -// $Id: US.php,v 1.10 2003/12/10 15:07:34 pajoye Exp $ +// $Id: US.php,v 1.11 2004/03/16 22:42:58 pajoye Exp $ // // Specific validation methods for data used in the United States // @@ -95,7 +95,7 @@ * @param array $high_groups array of highest issued group numbers * area number=>group number */ - function ssnCheck($ssnCheck, $group, $serial, &$high_groups) + function ssnCheck($ssnCheck, $group, $serial, $high_groups) { if(is_array($ssnCheck)){ extract($ssnCheck); @@ -145,7 +145,7 @@ $is_text = false) { if (!$is_text) { - if (!$fd = @fopen($source, 'r')) { + if (!$fd = @fopen($uri, 'r')) { trigger_error("Could not access the SSA High Groups file", E_USER_WARNING); return array(); } http://cvs.php.net/diff.php/pear/Validate/Validate/Finance/IBAN.php?r1=1.8&r2=1.9&ty=u Index: pear/Validate/Validate/Finance/IBAN.php diff -u pear/Validate/Validate/Finance/IBAN.php:1.8 pear/Validate/Validate/Finance/IBAN.php:1.9 --- pear/Validate/Validate/Finance/IBAN.php:1.8 Wed Feb 4 12:01:48 2004 +++ pear/Validate/Validate/Finance/IBAN.php Tue Mar 16 17:42:58 2004 @@ -16,7 +16,7 @@ // | Author: Stefan Neufeind <pear.neufeind@speedpartner.de> | // +----------------------------------------------------------------------+ // -// $Id: IBAN.php,v 1.8 2004/02/04 17:01:48 neufeind Exp $ +// $Id: IBAN.php,v 1.9 2004/03/16 22:42:58 pajoye Exp $ /* * Error codes for the IBAN interface, which will be mapped to textual messages @@ -297,7 +297,7 @@ // let's see if checksum is also correct $iban_replace_chars = range('A','Z'); foreach (range(10,35) as $tempvalue) { - $iban_replace_values[]=strval($tempvalue); + $iban_replace_values[]=strval($tempvalue); } // move first 4 chars (countrycode and checksum) to the end of the string @@ -379,11 +379,9 @@ if (!$this->validate()) { $this->_errorcode = VALIDATE_FINANCE_IBAN_GENERAL_INVALID; return PEAR::raiseError($this->errorMessage($this->_errorcode), $this->_errorcode, PEAR_ERROR_TRIGGER, E_USER_WARNING, $this->errorMessage($this->_errorcode)." in VALIDATE_FINANCE_IBAN::getBankcode()"); - } - else - { - $currCountrycodeBankcode = $this->_iban_countrycode_bankcode[ substr($iban,0,2) ]; - return substr($this->_iban,$currCountrycodeBankcode['start'],$currCountrycodeBankcode['length']); + } else { + $currCountrycodeBankcode = $this->_iban_countrycode_bankcode[ substr($this->_iban,0,2) ]; + return substr($this->_iban,$currCountrycodeBankcode['start'],$currCountrycodeBankcode['length']); } } // end func getBankcode @@ -398,9 +396,7 @@ if (!$this->validate()) { $this->_errorcode = VALIDATE_FINANCE_IBAN_GENERAL_INVALID; return PEAR::raiseError($this->errorMessage($this->_errorcode), $this->_errorcode, PEAR_ERROR_TRIGGER, E_USER_WARNING, $this->errorMessage($this->_errorcode)." in VALIDATE_FINANCE_IBAN::getBankaccount()"); - } - else - { + } else { $currCountrycodeBankcode = $this->_iban_countrycode_bankaccount[ substr($iban,0,2) ]; return substr($this->_iban,$currCountrycodeBankcode['start'],$currCountrycodeBankcode['length']); } @@ -441,4 +437,4 @@ return isset($errorMessages[$value]) ? $errorMessages[$value] : $errorMessages[VALIDATE_FINANCE_IBAN_ERROR]; } // end func errorMessage } // end class VALIDATE_FINANCE_IBAN -?> +?> \ No newline at end of file
« previous php.pear.cvs (#17470) next »