*
* - Set $wgUploadDirectory to a non-public directory (not web accessible)
* - Set $wgUploadPath to point to this file
*
* - Set $wgUploadDirectory to a non-public directory (not web accessible)
* - Set $wgUploadPath to point to this file
if ( strpos( $path, $prefix ) === 0 ) {
$be = FileBackendGroup::singleton()->backendFromPath( $storageDir );
$filename = $storageDir . substr( $path, strlen( $prefix ) ); // strip prefix
if ( strpos( $path, $prefix ) === 0 ) {
$be = FileBackendGroup::singleton()->backendFromPath( $storageDir );
$filename = $storageDir . substr( $path, strlen( $prefix ) ); // strip prefix
if ( $be->fileExists( array( 'src' => $filename ) ) ) {
wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." );
$be->streamFile( array( 'src' => $filename ),
array( 'Cache-Control: private', 'Vary: Cookie' ) );
} else {
if ( $be->fileExists( array( 'src' => $filename ) ) ) {
wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." );
$be->streamFile( array( 'src' => $filename ),
array( 'Cache-Control: private', 'Vary: Cookie' ) );
} else {
// Stream the requested file
wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." );
$repo->streamFile( $filename, array( 'Cache-Control: private', 'Vary: Cookie' ) );
// Stream the requested file
wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." );
$repo->streamFile( $filename, array( 'Cache-Control: private', 'Vary: Cookie' ) );
* Issue a standard HTTP 403 Forbidden header ($msg1-a message index, not a message) and an
* error message ($msg2, also a message index), (both required) then end the script
* subsequent arguments to $msg2 will be passed as parameters only for replacing in $msg2
* Issue a standard HTTP 403 Forbidden header ($msg1-a message index, not a message) and an
* error message ($msg2, also a message index), (both required) then end the script
* subsequent arguments to $msg2 will be passed as parameters only for replacing in $msg2
*/
function wfForbidden( $msg1, $msg2 ) {
global $wgImgAuthDetails;
*/
function wfForbidden( $msg1, $msg2 ) {
global $wgImgAuthDetails;