Error with get.php (requesting media)
If request URL is "/media/catalog/product/m/a/" (directory), Varien_File_Transfer_Adapter_Http error raise. Also affect older versions.
Fix: in "/pub/get.php" line 158: if (file_exists($file) || is_readable($file)) { change to: if (file_exists($file) && is_readable($file) && !is_dir($file)) {
@wlcheck , Sorry for the delay with the response! Usually, a path to an image is specified, not a directory. Since in the case you reported, an error occurs when a path to a directory is specified, we'd like to know in which case a user would specify path to a directory and not a file?
Hello, we had problem that once on our development server, media directory was not attached. Because of that, product image does not exist and also default image does not exists and we got a loop. I have traced it to this issue.
2014/1/2 Sergey Verklov, Senior Product Manager [email protected]
@wlcheck https://github.com/wlcheck , Sorry for the delay with the response! Usually, a path to an image is specified, not a directory. Since in the case you reported, an error occurs when a path to a directory is specified, we'd like to know in which case a user would specify path to a directory and not a file?
— Reply to this email directly or view it on GitHubhttps://github.com/magento/magento2/issues/296#issuecomment-31456325 .
@wlcheck , we will file this issue to our internal bug tracker and place it to the product backlog. Cannot make any promises as for the resolution. The issue will be processed based on the priorities. Anyway, thanks for reporting this to us~
@wlcheck , could you please verify this issue in the latest available build? I got confirmation form the team that Magento 2.x already contains a fix for this in "/pub/get.php". The method that contained this logic in 1.x - sendFile(), is removed in 2.X and is included in the lines referenced. That logic is only called from here now, instead of multiple locations, thus allowing for consistent checks.
Looks like the issue is no more relevant. Closing this issue.