Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.0.6, 4.1.3, 4.2.0alpha1, 4.2.0beta1, 4.3.0, 4.4.0alpha3
-
None
Description
In <b>index_image_mysql.php</b>, variable <i>$_SERVER['REQUEST_URI']</i> is taken to fetch image from DB. The problem is that this variable also contains the query string (ie <i>?nocache=12345783</i>) and fails when adding parameters to avoid browser caching an image.
It would be better to take <b>$_SERVER['SCRIPT_NAME']</b> as a reference :
<b>Actual index_image_mysql.php (line 33)</b> :
$filename = ltrim( $_SERVER['REQUEST_URI'], "/");
Should be :
$filename = ltrim( $_SERVER['SCRIPT_NAME'], "/");
Note : Also affects <i>index_image_mysqli.php</i> and <i>index_image_dfsmysql.php</i> (4.2)
Steps to reproduce
While using clustering, try to display an image with a query string.
Example : http://myhost/var/myvar/storage/images/media/images/test-image/3122-2-fre-FR/test-image_large.jpg?myquerystring
Displays a 404 error, while the image really exists
Attachments
Issue Links
- relates to
-
EZP-19599 index_cluster.php uses $_SERVER['SCRIPT_URL'], not set when using varnish
- Closed