X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=img_auth.php;h=e6485fc1119e8baaa861fc9b7da5988d43092b80;hb=5fc6bb9f16db3756bd48a48ab90355e26ec599cc;hp=d9b4a78bc5c0026c2d50817d799715b4f02ebc7d;hpb=a2ec67cfb54f0d3d1ea4d557dbb42468b7e378af;p=lhc%2Fweb%2Fwiklou.git diff --git a/img_auth.php b/img_auth.php index d9b4a78bc5..e6485fc111 100644 --- a/img_auth.php +++ b/img_auth.php @@ -30,6 +30,7 @@ require_once( dirname( __FILE__ ) . '/includes/WebStart.php' ); wfProfileIn( 'img_auth.php' ); require_once( dirname( __FILE__ ) . '/includes/StreamFile.php' ); +$wgActionPaths[] = $_SERVER['SCRIPT_NAME']; // See if this is a public Wiki (no protections) if ( $wgImgAuthPublicTest && in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) @@ -37,17 +38,8 @@ if ( $wgImgAuthPublicTest wfForbidden('img-auth-accessdenied','img-auth-public'); } -// Extract path and image information -if( !isset( $_SERVER['PATH_INFO'] ) ) { - $path = $wgRequest->getText( 'path' ); - if( !$path ) { - wfForbidden( 'img-auth-accessdenied', 'img-auth-nopathinfo' ); - } - $path = "/$path"; -} else { - $path = $_SERVER['PATH_INFO']; -} - +$matches = WebRequest::getPathInfo(); +$path = $matches['title']; $filename = realpath( $wgUploadDirectory . $path ); $realUpload = realpath( $wgUploadDirectory );