ZF-8111: Error Messages not diplaying in IsImage Validator
Description
Zend_Validate_File_IsImage is relying on the isValid method from Zend_Validate_File_MimeType which refers to its own error constants.
As such because IsImage has different constant values it fals to pull through the correct error messages
changing
const FALSE_TYPE = 'fileIsImageFalseType'; const NOT_DETECTED = 'fileIsImageNotDetected'; const NOT_READABLE = 'fileIsImageNotReadable';
to
const FALSE_TYPE = 'fileMimeTypeFalse'; const NOT_DETECTED = 'fileMimeTypeNotDetected'; const NOT_READABLE = 'fileMimeTypeNotReadable';
Resolves
Comments
Posted by Marco Kaiser (bate) on 2009-10-21T05:13:26.000+0000
I reproduced this bug. The problem is a late static binding problem because the isValid method depends on self:: this results in the wrong identifier and the unknown or not found messageTemplate String.
Solutions: 1. replace self:: with constant(get_class($this) . '') 2. remove from the class the own identifiers.
i preferr the 1 solution because the same behavior hits the other classes too. (ImageSize...)
Posted by Thomas Weidner (thomas) on 2009-10-21T11:47:43.000+0000
Fixed with r18659