mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-30 09:54:19 +00:00
Merge "Revert "Directly use $wgTitle instead of relying on getContextTitle fallback""
This commit is contained in:
commit
d75911245e
|
@ -1,8 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset>
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
||||
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle" />
|
||||
</rule>
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
|
||||
<file>.</file>
|
||||
<arg name="extensions" value="php,php5,inc" />
|
||||
<arg name="encoding" value="UTF-8" />
|
||||
|
|
|
@ -41,12 +41,11 @@ class CodeEditorHooks {
|
|||
* @throws ErrorPageError
|
||||
*/
|
||||
public static function editPageShowEditFormInitial( EditPage $editpage, OutputPage $output ) {
|
||||
global $wgTitle;
|
||||
|
||||
$title = $editpage->getContextTitle();
|
||||
$model = $editpage->contentModel;
|
||||
$format = $editpage->contentFormat;
|
||||
|
||||
$lang = self::getPageLanguage( $wgTitle, $model, $format );
|
||||
$lang = self::getPageLanguage( $title, $model, $format );
|
||||
if ( $lang && $output->getUser()->getOption( 'usebetatoolbar' ) ) {
|
||||
$output->addModules( 'ext.codeEditor' );
|
||||
$output->addJsConfigVars( 'wgCodeEditorCurrentLanguage', $lang );
|
||||
|
|
Loading…
Reference in a new issue