Skip to content

Commit

Permalink
Use ExtensionRegistry to check for Variables rather than deprecated E…
Browse files Browse the repository at this point in the history
…xtVariables::VERSION (#313)
  • Loading branch information
Universal-Omega authored Feb 9, 2025
1 parent e1d5790 commit 4cf213a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/Parse.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use MediaWiki\MediaWikiServices;
use MediaWiki\Parser\Parser;
use MediaWiki\Parser\ParserOutputLinkTypes;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Request\WebRequest;
use MediaWiki\Title\Title;

Expand Down Expand Up @@ -999,7 +1000,7 @@ private function getUrlArgs( Parser $parser ) {

Variables::setVar( [ '', '', $argName, $argValue ] );

if ( defined( 'ExtVariables::VERSION' ) ) {
if ( ExtensionRegistry::getInstance()->isLoaded( 'Variables' ) ) {
ExtVariables::get( $parser )->setVarValue( $argName, $argValue );
}
}
Expand All @@ -1019,7 +1020,7 @@ private function defineScrollVariables( $scrollVariables, Parser $parser ) {
foreach ( $scrollVariables as $variable => $value ) {
Variables::setVar( [ '', '', $variable, $value ?? '' ] );

if ( defined( 'ExtVariables::VERSION' ) ) {
if ( ExtensionRegistry::getInstance()->isLoaded( 'Variables' ) ) {
ExtVariables::get( $parser )->setVarValue( $variable, $value ?? '' );
}
}
Expand Down

0 comments on commit 4cf213a

Please sign in to comment.