Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libs/Zend/Validate/Iban.php')
-rw-r--r--libs/Zend/Validate/Iban.php49
1 files changed, 35 insertions, 14 deletions
diff --git a/libs/Zend/Validate/Iban.php b/libs/Zend/Validate/Iban.php
index 071651fd96..097cd32cbd 100644
--- a/libs/Zend/Validate/Iban.php
+++ b/libs/Zend/Validate/Iban.php
@@ -14,22 +14,22 @@
*
* @category Zend
* @package Zend_Validate
- * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Iban.php 16971 2009-07-22 18:05:45Z mikaelkael $
+ * @version $Id: Iban.php 21563 2010-03-19 10:10:45Z thomas $
*/
/**
* @see Zend_Validate_Abstract
*/
-require_once 'Zend/Validate/Abstract.php';
+// require_once 'Zend/Validate/Abstract.php';
/**
* Validates IBAN Numbers (International Bank Account Numbers)
*
* @category Zend
* @package Zend_Validate
- * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Validate_Iban extends Zend_Validate_Abstract
@@ -44,9 +44,9 @@ class Zend_Validate_Iban extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::NOTSUPPORTED => "'%value%' does not have IBAN",
- self::FALSEFORMAT => "'%value%' has a false format",
- self::CHECKFAILED => "'%value%' has failed the IBAN check"
+ self::NOTSUPPORTED => "Unknown country within the IBAN '%value%'",
+ self::FALSEFORMAT => "'%value%' has a false IBAN format",
+ self::CHECKFAILED => "'%value%' has failed the IBAN check",
);
/**
@@ -106,12 +106,31 @@ class Zend_Validate_Iban extends Zend_Validate_Abstract
/**
* Sets validator options
*
- * @param string|Zend_Locale $locale OPTIONAL
+ * @param string|Zend_Config|Zend_Locale $locale OPTIONAL
* @return void
*/
public function __construct($locale = null)
{
- if ($locale !== null) {
+ if ($locale instanceof Zend_Config) {
+ $locale = $locale->toArray();
+ }
+
+ if (is_array($locale)) {
+ if (array_key_exists('locale', $locale)) {
+ $locale = $locale['locale'];
+ } else {
+ $locale = null;
+ }
+ }
+
+ if ($locale !== false) {
+ // require_once 'Zend/Registry.php';
+ if (Zend_Registry::isRegistered('Zend_Locale')) {
+ $locale = Zend_Registry::get('Zend_Locale');
+ }
+ }
+
+ if (!empty($locale)) {
$this->setLocale($locale);
}
}
@@ -134,11 +153,13 @@ class Zend_Validate_Iban extends Zend_Validate_Abstract
*/
public function setLocale($locale = null)
{
- require_once 'Zend/Locale.php';
- $locale = Zend_Locale::findLocale($locale);
- if (strlen($locale) < 4) {
- require_once 'Zend/Validate/Exception.php';
- throw new Zend_Validate_Exception('Region must be given for IBAN validation');
+ if ($locale !== false) {
+ // require_once 'Zend/Locale.php';
+ $locale = Zend_Locale::findLocale($locale);
+ if (strlen($locale) < 4) {
+ // require_once 'Zend/Validate/Exception.php';
+ throw new Zend_Validate_Exception('Region must be given for IBAN validation');
+ }
}
$this->_locale = $locale;