ZF-3754: Zend_Validate_Abstract throws an notice when an array is defined in a validator class
Description
When a validator class is created which uses internally an array then a notice is thrown:
Notice: Array to string conversion in .....\Zend Framework\library\Zend\Validate\Abstract.php on line 205
Call Stack
1 0.0017 81016 {main}( ) ..\index2.php:0
2 0.0659 425640 Zend_File_Transfer_Adapter_Abstract->isValid( ) ..\index2.php:10
3 0.0726 464664 Zend_Validate_File_Extension->isValid( ) ..\Abstract.php:170
4 0.0727 465248 Zend_Validate_Abstract->_error( ) ..\Extension.php:138
5 0.0727 465664 Zend_Validate_Abstract->_createMessage( ) ..\Abstract.php:225
6 0.0735 466760 str_replace ( ) ..\Abstract.php:205
The class itself works as expected and validates correct but the notice should be supressed. PHP 5.2.5, Windows XP,
As this behaviour showed up while working on the new Zend_File_Transfer component I raised the priority to critical. This behaviour should be fixed / cleared before 1.6.RC2.
Comments
Posted by Hugo HAMON (emacs) on 2008-07-25T06:27:51.000+0000
The bugfix is to replace this line (205) :
$message = str_replace("%$ident%", $this->$property, $message);
by this one :
$message = str_replace("%$ident%", (string)$this->$property, $message);
Posted by Thomas Weidner (thomas) on 2008-11-07T01:38:25.000+0000
Fixed with r12359.
Posted by Wil Sinclair (wil) on 2008-11-13T14:10:03.000+0000
Changing issues in preparation for the 1.7.0 release.