From d4ceec677553239a42021b5bf8292dfaf9e05453 Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Wed, 30 Jul 2008 07:23:22 +0000 Subject: [PATCH] * (bug 14968) Specifying blank action parameter triggers API error now --- includes/api/ApiMain.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 86f7da8e64..c1d36bdba3 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -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); -- 2.20.1