X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=img_auth.php;h=ccaa8af0fcf1dcb7d141f6a77c06c7774ae17a06;hb=498eb5ea9a29784999ebe081a8dae60444bce2ce;hp=d7125897c5f9941e629bb361aa961067ec3888ac;hpb=0d22edd27be1b912d8a7da4a2180044189f23475;p=lhc%2Fweb%2Fwiklou.git diff --git a/img_auth.php b/img_auth.php index d7125897c5..ccaa8af0fc 100644 --- a/img_auth.php +++ b/img_auth.php @@ -43,12 +43,12 @@ define( 'MW_NO_OUTPUT_COMPRESSION', 1 ); if ( isset( $_SERVER['MW_COMPILED'] ) ) { require ( 'core/includes/WebStart.php' ); } else { - require ( dirname( __FILE__ ) . '/includes/WebStart.php' ); + require ( __DIR__ . '/includes/WebStart.php' ); } wfProfileIn( 'img_auth.php' ); # Set action base paths so that WebRequest::getPathInfo() -# recognizes the "X" as the 'title' in ../image_auth/X urls. +# recognizes the "X" as the 'title' in ../img_auth.php/X urls. $wgArticlePath = false; # Don't let a "/*" article path clober our action path $wgActionPaths = array( "$wgUploadPath/" ); @@ -60,8 +60,8 @@ function wfImageAuthMain() { // See if this is a public Wiki (no protections). if ( $wgImgAuthPublicTest - && in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) - { + && in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) + ) { // This is a public wiki, so disable this script (for private wikis only) wfForbidden( 'img-auth-accessdenied', 'img-auth-public' ); return; @@ -106,7 +106,7 @@ function wfImageAuthMain() { // Check to see if the file exists if ( !$repo->fileExists( $filename ) ) { - wfForbidden( 'img-auth-accessdenied','img-auth-nofile', $filename ); + wfForbidden( 'img-auth-accessdenied', 'img-auth-nofile', $filename ); return; } @@ -130,7 +130,7 @@ function wfImageAuthMain() { } // Stream the requested file - wfDebugLog( 'img_auth', "Streaming `".$filename."`." ); + wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." ); $repo->streamFile( $filename, array( 'Cache-Control: private', 'Vary: Cookie' ) ); } @@ -148,13 +148,13 @@ function wfForbidden( $msg1, $msg2 ) { array_shift( $args ); array_shift( $args ); - $msgHdr = htmlspecialchars( wfMsg( $msg1 ) ); + $msgHdr = wfMessage( $msg1 )->escaped(); $detailMsgKey = $wgImgAuthDetails ? $msg2 : 'badaccess-group0'; - $detailMsg = htmlspecialchars( wfMsg( $detailMsgKey, $args ) ); + $detailMsg = wfMessage( $detailMsgKey, $args )->escaped(); wfDebugLog( 'img_auth', - "wfForbidden Hdr:" . wfMsgExt( $msg1, array( 'language' => 'en' ) ). " Msg: ". - wfMsgExt( $msg2, array( 'language' => 'en' ), $args ) + "wfForbidden Hdr: " . wfMessage( $msg1 )->inLanguage( 'en' )->text() . " Msg: " . + wfMessage( $msg2, $args )->inLanguage( 'en' )->text() ); header( 'HTTP/1.0 403 Forbidden' );