Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14290

Function set_modified_headers() never sends 304 'Not Modified' header

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.9-RC1
    • 3.1.6, 3.2.0-dev
    • Viewing posts
    • None
    • PHP 5.6, MySQL 5.6, Firefox 44

      set_modified_headers() checks for non-existent 'Modified-Since' request header instead of 'If-Modified-Since'.

      How to reproduce: open any page containing avatars or attached images. Refresh it several times. Images are always reloaded with 200/201 status while 304 is expected.

      Possible fix:

      --- includes/functions_download.php
      +++ includes/functions_download.php
      @@ -410,11 +410,11 @@
       function set_modified_headers($stamp, $browser)
       {
       	global $request;
       
       	// let's see if we have to send the file at all
      -	$last_load 	=  $request->header('Modified-Since') ? strtotime(trim($request->header('Modified-Since'))) : false;
      +	$last_load 	=  $request->header('If-Modified-Since') ? strtotime(trim($request->header('If-Modified-Since'))) : false;
       
       	if (strpos(strtolower($browser), 'msie 6.0') === false && !phpbb_is_greater_ie_version($browser, 7))
       	{
       		if ($last_load !== false && $last_load >= $stamp)
       		{
      
      

            Marc Marc
            Nekstati Nekstati
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: