Removed trailing commas mistakenly added in r72682
[lhc/web/wiklou.git] / img_auth.php
index bc4464d..b99773b 100644 (file)
@@ -38,11 +38,16 @@ if ( $wgImgAuthPublicTest
 }
 
 // Extract path and image information
-if( !isset( $_SERVER['PATH_INFO'] ) )
-       wfForbidden('img-auth-accessdenied','img-auth-nopathinfo');
+if( !isset( $_SERVER['PATH_INFO'] ) ) {
+       $path = $wgRequest->getText( 'path' );
+       if( !$path ) {
+        wfForbidden( 'img-auth-accessdenied', 'img-auth-nopathinfo' );
+       }
+} else {
+       $path = $_SERVER['PATH_INFO'];
+}
 
-$path = $_SERVER['PATH_INFO'];
-$filename = realpath( $wgUploadDirectory . $_SERVER['PATH_INFO'] );
+$filename = realpath( $wgUploadDirectory . '/' . $path );
 $realUpload = realpath( $wgUploadDirectory );
 
 // Basic directory traversal check