summaryrefslogtreecommitdiff
path: root/includes/StreamFile.php
diff options
context:
space:
mode:
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 8ecaa4f0..2dbbe6de 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 );