* (bug 14968) Specifying blank action parameter triggers API error now
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Wed, 30 Jul 2008 07:23:22 +0000 (07:23 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Wed, 30 Jul 2008 07:23:22 +0000 (07:23 +0000)
includes/api/ApiMain.php

index 86f7da8..c1d36bd 100644 (file)
@@ -347,6 +347,10 @@ class ApiMain extends ApiBase {
                $this->mShowVersions = $params['version'];
                $this->mAction = $params['action'];
 
+               if( !is_string( $this->mAction ) ) {
+                       $this->dieUsage( "The API requires a valid action parameter", 'unknown_action' );
+               }
+
                // Instantiate the module requested by the user
                $module = new $this->mModules[$this->mAction] ($this, $this->mAction);