From: Brion Vibber Date: Tue, 2 Jan 2007 08:10:56 +0000 (+0000) Subject: use the full smörgåsbord of anti-caching headers; 'Cache-Control' alone will be ignor... X-Git-Tag: 1.31.0-rc.0~54697 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=5f2bf9420f204dff711b15a3339e3c9f70432739;p=lhc%2Fweb%2Fwiklou.git use the full smörgåsbord of anti-caching headers; 'Cache-Control' alone will be ignored by HTTP 1.0 proxies, which may or may not be out there doing evil things --- 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 ); }