ZF-3756: Notice: Array to string conversion in /home/communs/library/Zend/Validate/Abstract.php on line 210

Issue Type: Bug Created: 2008-07-25T06:05:05.000+0000 Last Updated: 2008-11-07T01:38:57.000+0000 Status: Resolved Fix version(s): Reporter: Hugo HAMON (emacs) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: - ZF-3754



When using the latest version of the Zend_File component, I've got a notice error in my XDebug. Below is the code I've tried :

addValidators('Extension', 'png')->setDestination(dirname(\_\_FILE\_\_).'/uploads'); $oFileTransfer->receive(); } catch(Zend\_Exception $e) { echo ' ', print_r($oFileTransfer->getMessages()) ,' '; } ?> I'm using an to upload a file. I've tried with an .exe file. The bad extension is well stopped by the validator and the upload process too but I've got this notice in XDebug :

Notice: Array to string conversion in /home/noeweb5/communs/library/Zend/Validate/Abstract.php on line 210

Call Stack

Time Memory Function Location

1 0.0005 67804 {main}( ) ../upload.php:0 2 0.0715 2784324 Zend_File_Transfer_Adapter_Http->receive( ) ../upload.php:38 3 0.0715 2784324 Zend_File_Transfer_Adapter_Abstract->isValid( ) ../Http.php:88 4 0.0716 2785080 Zend_Validate_File_Extension->isValid( ) ../Abstract.php:170 5 0.0717 2785228 Zend_Validate_Abstract->_error( ) ../Extension.php:154 6 0.0717 2785388 Zend_Validate_Abstract->_createMessage( ) ../Abstract.php:231 7 0.0719 2786248 str_replace ( ) ../Abstract.php:210

I think it comes from the $_extension attribute of the Zend_Validate_File_Extension class is an array of valid extension. But at line 210 of the class Zend_Validate_Abstract, the str_replace() function attemps a string value as its second argument.


Posted by Hugo HAMON (emacs) on 2008-07-25T06:06:53.000+0000

Edit presentation of the sample of code.

Posted by Thomas Weidner (thomas) on 2008-07-25T10:22:49.000+0000

Duplicate issue of ZF-3754

Posted by Thomas Weidner (thomas) on 2008-11-07T01:38:57.000+0000

Fixed with r12359

Have you found an issue?

See the Overview section for more details.


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

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