ZF-9889: Wrong test for exists locale
Description
Hi, i have problem with commit #22278. After this commit is generated WARNING:
Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/lestr/projekty/alarm-online/trunk/library/Zend/Locale.php on line 811
I think there is missing negation before calling is_array function.
This is svn diff from my local copy of releace branche
--- library/Zend/Locale.php (revision 329)
+++ library/Zend/Locale.php (working copy)
@@ -808,7 +808,7 @@
public static function isLocale($locale, $strict = false, $compatible = true)
{
if (($locale instanceof Zend_Locale)
- || (is_array($locale) && array_key_exists($locale, self::$_localeData))
+ || (!is_array($locale) && array_key_exists($locale, self::$_localeData))
) {
return true;
}
Is this fix correct?
Comments
Posted by Mickael Perraud (mikaelkael) on 2010-05-27T02:00:42.000+0000
I don't know if it's the correct fix but I can confirm that there is a bug.
I think that should be:
Posted by Thomas Weidner (thomas) on 2010-05-27T14:27:46.000+0000
Fixed by r22314