ZF-11869: Zend_File_Transfer_Adapter_Abstract::_detectMimeType should not check existence of file by its name
I'm using Zend_File_Transfer to handle POSTed file uploads and ran into a nasty edge case.
Zend_File_Transfer_Adapter_Abstract line 1283 is checking the existence of the posted file by its name parameter before checking its existence by its tmp_name parameter. The problem is that the name parameter is not a path, so it's checking for its existence in the current working directory, which is my application's root directory. In my application's root dir, I have a CMakeLists.txt file. When I tried to upload a file to my application that was also named CMakeLists.txt, I got the following warning:
Warning: finfo_file() [function.finfo-file]: File or path not found 'CMakeLists.txt'
on line 1302 in file C:\xampp\htdocs\Midas3\library\Zend\File\Transfer\Adapter\Abstract.php
file_exists was returning true for the name parameter, which screwed up the rest of the method. Why do you check if the file exists by its name? The tmp_name param is the one that refers to the actual file, it seems to me that's the only one that should be used.