Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-15459

Cluster : Script for delivering images should not take into account query string

    XMLWordPrintable

Details

    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

        Activity

          People

            andre1 andre1
            9e9f2c72-d8ff-4ec0-b8df-c5a744234b9a@accounts.ibexa.co Jérôme Vieilledent
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: