X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialApiHelp.php;h=54480132e4cafbe68830566867afabf8dcadc86e;hb=c2f9376c19335219d403e602496fa44f4a3e7b55;hp=b43911f56d94e4046b80db1f22bece791b010aa5;hpb=81c698cc8caf94e03d9457b67e1b4e94d47c7f4f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialApiHelp.php b/includes/specials/SpecialApiHelp.php index b43911f56d..54480132e4 100644 --- a/includes/specials/SpecialApiHelp.php +++ b/includes/specials/SpecialApiHelp.php @@ -39,13 +39,13 @@ class SpecialApiHelp extends UnlistedSpecialPage { // These come from transclusions $request = $this->getRequest(); - $options = array( + $options = [ 'action' => 'help', 'nolead' => true, 'submodules' => $request->getCheck( 'submodules' ), 'recursivesubmodules' => $request->getCheck( 'recursivesubmodules' ), 'title' => $request->getVal( 'title', $this->getPageTitle( '$1' )->getPrefixedText() ), - ); + ]; // These are for linking from wikitext, since url parameters are a pain // to do. @@ -77,8 +77,13 @@ class SpecialApiHelp extends UnlistedSpecialPage { $main = new ApiMain( $this->getContext(), false ); try { $module = $main->getModuleFromPath( $moduleName ); + } catch ( ApiUsageException $ex ) { + $this->getOutput()->addHTML( Html::rawElement( 'span', [ 'class' => 'error' ], + $this->msg( 'apihelp-no-such-module', $moduleName )->inContentLanguage()->parse() + ) ); + return; } catch ( UsageException $ex ) { - $this->getOutput()->addHTML( Html::rawElement( 'span', array( 'class' => 'error' ), + $this->getOutput()->addHTML( Html::rawElement( 'span', [ 'class' => 'error' ], $this->msg( 'apihelp-no-such-module', $moduleName )->inContentLanguage()->parse() ) ); return;