From aab9a97c96c945b1818b340765ae28bb721cc769 Mon Sep 17 00:00:00 2001 From: Derick Alangi Date: Mon, 2 Sep 2019 09:54:59 +0100 Subject: [PATCH] Avoid usage of deprecated $wgContLang global (dep in 1.32) Change-Id: I1c3d9b6d9de3c7ef24f24f45aad9510be3f8b588 --- includes/InputBox.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/InputBox.php b/includes/InputBox.php index 3c253526..d79d2f7a 100644 --- a/includes/InputBox.php +++ b/includes/InputBox.php @@ -6,6 +6,8 @@ * @ingroup Extensions */ +use MediaWiki\MediaWikiServices; + /** * InputBox class */ @@ -128,7 +130,7 @@ class InputBox { * @return string HTML */ public function getSearchForm( $type ) { - global $wgContLang, $wgNamespaceAliases; + global $wgNamespaceAliases; // Use button label fallbacks if ( !$this->mButtonLabel ) { @@ -189,8 +191,9 @@ class InputBox { // Determine namespace checkboxes $namespacesArray = explode( ',', $this->mNamespaces ); if ( $this->mNamespaces ) { - $namespaces = $wgContLang->getNamespaces(); - $nsAliases = array_merge( $wgContLang->getNamespaceAliases(), $wgNamespaceAliases ); + $contLang = MediaWikiServices::getInstance()->getContentLanguage(); + $namespaces = $contLang->getNamespaces(); + $nsAliases = array_merge( $contLang->getNamespaceAliases(), $wgNamespaceAliases ); $showNamespaces = []; $checkedNS = []; // Check for valid namespaces