From 5f2bf9420f204dff711b15a3339e3c9f70432739 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 2 Jan 2007 08:10:56 +0000 Subject: [PATCH] =?utf8?q?use=20the=20full=20sm=C3=B6rg=C3=A5sbord=20of=20?= =?utf8?q?anti-caching=20headers;=20'Cache-Control'=20alone=20will=20be=20?= =?utf8?q?ignored=20by=20HTTP=201.0=20proxies,=20which=20may=20or=20may=20?= =?utf8?q?not=20be=20out=20there=20doing=20evil=20things?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- includes/SpecialUndelete.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index e471344070..7c9b119111 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -575,14 +575,17 @@ class UndeleteForm { * Show a deleted file version requested by the visitor. */ function showFile( $key ) { - global $wgOut; + global $wgOut, $wgRequest; $wgOut->disable(); # We mustn't allow the output to be Squid cached, otherwise # if an admin previews a deleted image, and it's cached, then # a user without appropriate permissions can toddle off and # nab the image, and Squid will serve it - header( 'Cache-Control: no-cache' ); + $wgRequest->response()->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' ); + $wgRequest->response()->header( 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' ); + $wgRequest->response()->header( 'Pragma: no-cache' ); + $store = FileStore::get( 'deleted' ); $store->stream( $key ); } -- 2.20.1