Browse Source

[ZF-8448] Zend_Translate:

- omit warning on isTranslated

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20402 44c647ce-9c0f-0410-b52a-842ac1e357ba
thomas 16 năm trước cách đây
mục cha
commit
23aaab52f3
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      library/Zend/Translate/Adapter.php

+ 2 - 2
library/Zend/Translate/Adapter.php

@@ -699,14 +699,14 @@ abstract class Zend_Translate_Adapter {
         }
 
         $locale = (string) $locale;
-        if (isset($this->_translate[$locale][$messageId]) === true) {
+        if ((is_string($messageId) || is_int($messageId)) && isset($this->_translate[$locale][$messageId])) {
             // return original translation
             return true;
         } else if ((strlen($locale) != 2) and ($original === false)) {
             // faster than creating a new locale and separate the leading part
             $locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
 
-            if (isset($this->_translate[$locale][$messageId]) === true) {
+            if ((is_string($messageId) || is_int($messageId)) && isset($this->_translate[$locale][$messageId])) {
                 // return regionless translation (en_US -> en)
                 return true;
             }