Issues

ZF-6406: Zend_File_Transfer_Adapter_Http does not remove Rename filter correctly in receive()

Description

Zend_File_Transfer_Adapter_Http does not remove Rename filter correctly in receive().

Patch:


Index: library/Zend/File/Transfer/Adapter/Http.php
===================================================================
--- library/Zend/File/Transfer/Adapter/Http.php
+++ library/Zend/File/Transfer/Adapter/Http.php
@@ -161,7 +161,7 @@
                 $rename   = $this->getFilter('Rename');
                 if ($rename !== null) {
                     $filename = $rename->getNewName($content['tmp_name']);
-                    $key      = array_search('Rename', $this->_files[$file]['filters']);
+                    $key      = array_search(get_class($rename), $this->_files[$file]['filters']);
                     unset($this->_files[$file]['filters'][$key]);
                 }

As a side effect, since array_search() returns false, the filter at offset 0 in $this->_files[$file]['filters'] will be removed.

Comments

No comments to display