magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Error with get.php (requesting media)

Open wlcheck opened this issue 13 years ago • 5 comments

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 avatar May 22 '13 11:05 wlcheck

@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?

verklov avatar Jan 02 '14 14:01 verklov

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 avatar Jan 02 '14 16:01 wlcheck

@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~

verklov avatar Jan 03 '14 15:01 verklov

@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.

tanya-soroka avatar Feb 20 '14 21:02 tanya-soroka

Looks like the issue is no more relevant. Closing this issue.

verklov avatar Apr 17 '14 13:04 verklov