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

Make message templates working properly in PHP 5.5 by defining them in the class itself (see PHP#63976)

Ondřej Machulda 12 лет назад
Родитель
Сommit
83f344741d

+ 9 - 0
library/Zend/Validate/File/ExcludeMimeType.php

@@ -39,6 +39,15 @@ class Zend_Validate_File_ExcludeMimeType extends Zend_Validate_File_MimeType
     const NOT_READABLE = 'fileExcludeMimeTypeNotReadable';
 
     /**
+     * @var array Error message templates
+     */
+    protected $_messageTemplates = array(
+        self::FALSE_TYPE   => "File '%value%' has a false mimetype of '%type%'",
+        self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
+        self::NOT_READABLE => "File '%value%' is not readable or does not exist",
+    );
+
+    /**
      * Defined by Zend_Validate_Interface
      *
      * Returns true if the mimetype of the file does not matche the given ones. Also parts

+ 1 - 2
library/Zend/Validate/File/MimeType.php

@@ -34,13 +34,12 @@ require_once 'Zend/Validate/Abstract.php';
  */
 class Zend_Validate_File_MimeType extends Zend_Validate_Abstract
 {
-    /**#@+
+    /**
      * @const Error type constants
      */
     const FALSE_TYPE   = 'fileMimeTypeFalse';
     const NOT_DETECTED = 'fileMimeTypeNotDetected';
     const NOT_READABLE = 'fileMimeTypeNotReadable';
-    /**#@-*/
 
     /**
      * @var array Error message templates