Update OOjs UI to v0.1.0-pre (55b861b167)
[lhc/web/wiklou.git] / api.php
diff --git a/api.php b/api.php
index 80abc35..2a6a095 100644 (file)
--- a/api.php
+++ b/api.php
@@ -108,8 +108,13 @@ if ( $wgAPIRequestLog ) {
        );
        $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() );