X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=img_auth.php;h=205280908b7095aa5b46c02a2750b5e8fd70bf59;hp=d63618817a19ec4da0dc043aac146dff9fb7f2e1;hb=a7064a0883ec6d715c8c8103efe777769a85437d;hpb=2f885ee6b797e5a176ce7b270b674a04b5945b06 diff --git a/img_auth.php b/img_auth.php index d63618817a..205280908b 100644 --- a/img_auth.php +++ b/img_auth.php @@ -68,7 +68,7 @@ function wfImageAuthMain() { $path = "/" . $path; } - // Check for bug 28235: QUERY_STRING overriding the correct extension + // Check for T30235: QUERY_STRING overriding the correct extension $whitelist = []; $extension = FileBackend::extensionFromPath( $path, 'rawcase' ); if ( $extension != '' ) { @@ -162,13 +162,21 @@ function wfImageAuthMain() { } } + $options = []; // HTTP header options + if ( isset( $_SERVER['HTTP_RANGE'] ) ) { + $options['range'] = $_SERVER['HTTP_RANGE']; + } + if ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) { + $options['if-modified-since'] = $_SERVER['HTTP_IF_MODIFIED_SINCE']; + } + if ( $request->getCheck( 'download' ) ) { $headers[] = 'Content-Disposition: attachment'; } // Stream the requested file wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." ); - $repo->streamFile( $filename, $headers ); + $repo->streamFile( $filename, $headers, $options ); } /**