Clarify comment on $wgRateLimits.
[lhc/web/wiklou.git] / includes / StreamFile.php
index dc653e5..2dbbe6d 100644 (file)
@@ -2,7 +2,7 @@
 /** */
 
 /** */
-function wfStreamFile( $fname ) {
+function wfStreamFile( $fname, $headers = array() ) {
        $stat = @stat( $fname );
        if ( !$stat ) {
                header( 'HTTP/1.0 404 Not Found' );
@@ -31,6 +31,13 @@ function wfStreamFile( $fname ) {
                header('Content-type: application/x-wiki');
        }
 
+       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 );
@@ -69,4 +76,4 @@ function wfGetType( $filename ) {
        }
 }
 
-?>
+