Issues

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

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...)

Fixed with r18659