*/
use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
/**
* A simple method to retrieve the plain source of an article,
$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
]
$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' ) );
* @return string|bool
*/
public function getRawText() {
- global $wgParser;
-
$text = false;
$title = $this->getTitle();
$request = $this->getRequest();
}
if ( $text !== false && $text !== '' && $request->getRawVal( 'templates' ) === 'expand' ) {
- $text = $wgParser->preprocess(
+ $text = MediaWikiServices::getInstance()->getParser()->preprocess(
$text,
$title,
ParserOptions::newFromContext( $this->getContext() )