X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Factions%2FRawAction.php;h=14f76037858eb86beb28827798b7f4a23c414954;hb=9189db0c50cd4f755efc1d0ce061f6c04b236a40;hp=c8f1a8d2f0b43beeb6012cbf56d1278b018f7b85;hpb=f2b01310d90060ba2ccba3e6d36b67e942bff978;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php index c8f1a8d2f0..14f7603785 100644 --- a/includes/actions/RawAction.php +++ b/includes/actions/RawAction.php @@ -27,6 +27,7 @@ */ use MediaWiki\Logger\LoggerFactory; +use MediaWiki\MediaWikiServices; /** * A simple method to retrieve the plain source of an article, @@ -119,7 +120,7 @@ class RawAction extends FormlessAction { "Unsafe JS/CSS/Json {$elevatedText}load - {user} loaded {title} with {ctype}", [ 'user' => $this->getUser()->getName(), - 'title' => $title->getPrefixedDBKey(), + 'title' => $title->getPrefixedDBkey(), 'ctype' => $contentType, 'elevated' => $elevated ] @@ -147,7 +148,7 @@ class RawAction extends FormlessAction { $log->info( "Blocked loading unprotected JS {title} for {user}", [ 'user' => $this->getUser()->getName(), - 'title' => $title->getPrefixedDBKey(), + 'title' => $title->getPrefixedDBkey(), ] ); throw new HttpError( 403, wfMessage( 'unprotected-js' ) ); @@ -181,8 +182,6 @@ class RawAction extends FormlessAction { * @return string|bool */ public function getRawText() { - global $wgParser; - $text = false; $title = $this->getTitle(); $request = $this->getRequest(); @@ -221,7 +220,7 @@ class RawAction extends FormlessAction { } if ( $text !== false && $text !== '' && $request->getRawVal( 'templates' ) === 'expand' ) { - $text = $wgParser->preprocess( + $text = MediaWikiServices::getInstance()->getParser()->preprocess( $text, $title, ParserOptions::newFromContext( $this->getContext() )