aboutsummaryrefslogtreecommitdiffstats
path: root/includes/StreamFile.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@users.mediawiki.org>2007-11-03 02:38:40 +0000
committerTim Starling <tstarling@users.mediawiki.org>2007-11-03 02:38:40 +0000
commit6b5e2f5f0b96f05e66789a9849e455db4df35cf0 (patch)
tree80f41ed6ff0f542a3a245f540570038d3d5945a2 /includes/StreamFile.php
parent7f6c911e42b432f1db0ba447fdc5e134d7e7a167 (diff)
downloadmediawikicore-6b5e2f5f0b96f05e66789a9849e455db4df35cf0.tar.gz
mediawikicore-6b5e2f5f0b96f05e66789a9849e455db4df35cf0.zip
Send Cache-Control: private and Vary headers in img_auth.php.
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/27149
Diffstat (limited to 'includes/StreamFile.php')
-rw-r--r--includes/StreamFile.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/StreamFile.php b/includes/StreamFile.php
index 8ecaa4f00658..2dbbe6dee3cd 100644
--- a/includes/StreamFile.php
+++ b/includes/StreamFile.php
@@ -2,7 +2,7 @@
/** */
/** */
-function wfStreamFile( $fname ) {
+function wfStreamFile( $fname, $headers = array() ) {
$stat = @stat( $fname );
if ( !$stat ) {
header( 'HTTP/1.0 404 Not Found' );
@@ -34,6 +34,10 @@ function wfStreamFile( $fname ) {
global $wgContLanguageCode;
header( "Content-Disposition: inline;filename*=utf-8'$wgContLanguageCode'" . urlencode( basename( $fname ) ) );
+ foreach ( $headers as $header ) {
+ header( $header );
+ }
+
if ( !empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
$modsince = preg_replace( '/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
$sinceTime = strtotime( $modsince );