Skip to content

Commit

Permalink
Avoid to silently ignore non-existing parameters
Browse files Browse the repository at this point in the history
All the parameters $wgMatomo* should exist and have a default value.
Previously $wgMatomoIgnoreEditors was used but not defined. Now it will
return a ConfigException in such cases – which should not never occur.
  • Loading branch information
Seb35 committed Oct 26, 2023
1 parent f0c0042 commit a3157c3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ public static function getParameter( $name ) {
$config = \MediaWiki\MediaWikiServices::getInstance()->getMainConfig();
if ( $config->has( "Piwik$name" ) ) {
return $config->get( "Piwik$name" );
} elseif ( $config->has( "Matomo$name" ) ) {
return $config->get( "Matomo$name" );
}
return null;
return $config->get( "Matomo$name" );
}

/**
Expand Down

0 comments on commit a3157c3

Please sign in to comment.