X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=api.php;h=2a6a095de1ada9c3b2026e7a33936be327623d3a;hb=90a7642c761c2c3d00ba77d70ddf28eb19bbfc96;hp=e8a911e3a10784a83e7e3c18781b8f4b56e93e0a;hpb=d2aa30c032f92f601262d8cdb611c481e87d6ad9;p=lhc%2Fweb%2Fwiklou.git diff --git a/api.php b/api.php index e8a911e3a1..2a6a095de1 100644 --- a/api.php +++ b/api.php @@ -104,12 +104,17 @@ if ( $wgAPIRequestLog ) { wfTimestamp( TS_MW ), $endtime - $starttime, $wgRequest->getIP(), - $_SERVER['HTTP_USER_AGENT'] + $wgRequest->getHeader( 'User-agent' ) ); $items[] = $wgRequest->wasPosted() ? 'POST' : 'GET'; if ( $processor ) { - $module = $processor->getModule(); - if ( $module->mustBePosted() ) { + try { + $manager = $processor->getModuleManager(); + $module = $manager->getModule( $wgRequest->getVal( 'action' ), 'action' ); + } catch ( Exception $ex ) { + $module = null; + } + if ( !$module || $module->mustBePosted() ) { $items[] = "action=" . $wgRequest->getVal( 'action' ); } else { $items[] = wfArrayToCgi( $wgRequest->getValues() );