Apply live hack -- exception for invalid actions (as opposed to....?)
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 19 Jun 2008 23:48:09 +0000 (23:48 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 19 Jun 2008 23:48:09 +0000 (23:48 +0000)
includes/api/ApiMain.php

index b0096d0..84fc81f 100644 (file)
@@ -339,7 +339,12 @@ class ApiMain extends ApiBase {
 
                $this->mShowVersions = $params['version'];
                $this->mAction = $params['action'];
-
+               
+               # For debugging -- TS
+               if ( !isset( $this->mModules[$this->mAction] ) ) {
+                       throw new MWException( "Invalid action: {$this->mAction}" );
+               }
+               
                // Instantiate the module requested by the user
                $module = new $this->mModules[$this->mAction] ($this, $this->mAction);