ZF-8111: Error Messages not diplaying in IsImage Validator

Issue Type: Bug Created: 2009-10-21T04:18:36.000+0000 Last Updated: 2010-01-12T04:08:57.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Matt Cockayne (matt.cockayne) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: - ZF-8598



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


const FALSE_TYPE = 'fileIsImageFalseType'; const NOT_DETECTED = 'fileIsImageNotDetected'; const NOT_READABLE = 'fileIsImageNotReadable';


const FALSE_TYPE = 'fileMimeTypeFalse'; const NOT_DETECTED = 'fileMimeTypeNotDetected'; const NOT_READABLE = 'fileMimeTypeNotReadable';



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

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.