Просмотр исходного кода

ZF-11112
Zend_Translate
Zend_Translate_Adapter emits notice when 'content' option is not provided to addTranslation()


git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23962 44c647ce-9c0f-0410-b52a-842ac1e357ba

adamlundrigan 14 лет назад
Родитель
Сommit
37ecc2fcbe
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      library/Zend/Translate/Adapter.php

+ 5 - 0
library/Zend/Translate/Adapter.php

@@ -212,6 +212,11 @@ abstract class Zend_Translate_Adapter {
         } else if (!is_array($options)) {
             $options = array('content' => $options);
         }
+        
+        if (!isset($options['content']) || empty($options['content'])) {
+            require_once 'Zend/Translate/Exception.php';
+            throw new Zend_Translate_Exception("Required option 'content' is missing");
+        }
 
         $originate = null;
         if (!empty($options['locale'])) {