From caa4b4557757fbdaa0377f21203ed94c9e8d6f29 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 27 Apr 2006 21:46:03 +0000 Subject: [PATCH] Fix #5315: "Expires: -1" HTTP header not strictly RFC valid --- RELEASE-NOTES | 1 + includes/OutputPage.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 94c09a8477..5dcfbfb5c6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -130,6 +130,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Improvements to update scripts; print out the version, check for superuser credentials before attempting a connection, and produce a friendlier error if the connection fails * (bug 5005): Fix XHTML output. +* (bug 5315) "Expires: -1" HTTP header made strictly valid (using 1970 date). == Compatibility == diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 4aecedbfb0..d6e653acb0 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -445,7 +445,7 @@ class OutputPage { # We do want clients to cache if they can, but they *must* check for updates # on revisiting the page. wfDebug( "** private caching; {$this->mLastModified} **\n", false ); - header( "Expires: -1" ); + header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' ); header( "Cache-Control: private, must-revalidate, max-age=0" ); } if($this->mLastModified) header( "Last-modified: {$this->mLastModified}" ); @@ -454,7 +454,7 @@ class OutputPage { # In general, the absence of a last modified header should be enough to prevent # the client from using its cache. We send a few other things just to make sure. - header( 'Expires: -1' ); + header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' ); header( 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' ); header( 'Pragma: no-cache' ); } -- 2.20.1