From: Siebrand Mazeland Date: Mon, 30 Dec 2013 17:37:51 +0000 (+0100) Subject: Throw exception on invalid RecentChange types X-Git-Tag: 1.31.0-rc.0~17301^2 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=aeb358f0c3d9b71596af418a28d8d2001dcceca4;p=lhc%2Fweb%2Fwiklou.git Throw exception on invalid RecentChange types Change-Id: I39279a13a2eb5891991e1c3b4bee0fafe844f1f2 --- diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 02a05e8e5d..b298003fed 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -559,6 +559,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { return $retval; } + switch ( $type ) { case 'edit': return RC_EDIT; @@ -568,6 +569,8 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { return RC_LOG; case 'external': return RC_EXTERNAL; + default: + ApiBase::dieDebug( __METHOD__, "Unknown type '$type'" ); } } diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index f8e521f356..3465e48c79 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -374,6 +374,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { return $retval; } + switch ( $type ) { case 'edit': return RC_EDIT; @@ -383,6 +384,8 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { return RC_LOG; case 'external': return RC_EXTERNAL; + default: + ApiBase::dieDebug( __METHOD__, "Unknown type '$type'" ); } }