ZF-10556: Zend_Validate_Iban(array('locale' => false)) does not function see description for solution

Issue Type: Bug Created: 2010-10-14T05:30:44.000+0000 Last Updated: 2012-10-01T16:32:23.000+0000 Status: Resolved Fix version(s): - Next Major Release ()

Reporter: Samuel (michizend) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: - ZF-11778



IMHO to solve the problem you souhould change the line 125 in Iban.php FROM: if (empty($locale)) { TO: if (empty($locale) && $locale != false) {

greetings Michael


Posted by Thomas Weidner (thomas) on 2011-08-25T21:35:11.000+0000

Fixed in ZF2 with GH-316

Posted by Chl (chl) on 2012-10-01T16:32:23.000+0000


sorry to wake this bug up, but this hasn't made to the 1.12 release. It still isn't possible to validate an IBAN without restriction to a country like the doc says :…

Could it be backported to 1.11 and 1.12 ?

Here is a code test it with php-cli :

<pre class="highlight">

ini_set('include_path', '.:/tmp/ZendFramework-1.12.0-minimal/library');

// I try to simulate a full Zend, launched from a browser.
// Not very clean, maybe :)
require_once 'Zend/Validate/Iban.php';
require_once 'Zend/Locale.php';
require_once 'Zend/Registry.php';
Zend_Registry::set('Zend_Locale', new Zend_Locale);

// Code pasted from doc
$validator = new Zend_Validate_Iban(array('locale' => false));

if ($validator->isValid('AT611904300234573201')) {
    echo "IBAN appears to be valid.\n";
} else {
    echo "IBAN is not valid.\n";

Launch it with :

<pre class="literal">
HTTP_ACCEPT_LANGUAGE="de_AT" php test.php
HTTP_ACCEPT_LANGUAGE="fr_FR" php test.php

NB : got a stacktrace with...

<pre class="literal">
HTTP_ACCEPT_LANGUAGE="fr" php test.php

...which appears legal, no ?

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.