Stop calling FileRepo->streamFile()
[lhc/web/wiklou.git] / includes / actions / RawAction.php
index 73594bc..14f7603 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
 
 /**
  * A simple method to retrieve the plain source of an article,
@@ -116,10 +117,10 @@ class RawAction extends FormlessAction {
                                $elevatedText = $elevated ? 'by elevated ' : '';
                                $log = LoggerFactory::getInstance( "security" );
                                $log->warning(
-                                       "Unsafe JS/CSS/Json $elevatedText" . "load - {user} loaded {title} with {ctype}",
+                                       "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() )