Browse Source

[GENERIC] Zend_Locale:

- performance increasement on isLocale

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@17330 44c647ce-9c0f-0410-b52a-842ac1e357ba
thomas 16 years ago
parent
commit
b84e66178d
1 changed files with 8 additions and 0 deletions
  1. 8 0
      library/Zend/Locale.php

+ 8 - 0
library/Zend/Locale.php

@@ -748,6 +748,14 @@ class Zend_Locale
      */
     public static function isLocale($locale, $strict = false, $compatible = true)
     {
+        if ($locale instanceof Zend_Locale) {
+            return true;
+        }
+
+        if (($locale !== null) and !is_string($locale) and !is_array($locale)) {
+            return false;
+        }
+
         try {
             $locale = self::_prepareLocale($locale, $strict);
         } catch (Zend_Locale_Exception $e) {