From aeb358f0c3d9b71596af418a28d8d2001dcceca4 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Mon, 30 Dec 2013 18:37:51 +0100 Subject: [PATCH] Throw exception on invalid RecentChange types Change-Id: I39279a13a2eb5891991e1c3b4bee0fafe844f1f2 --- includes/api/ApiQueryRecentChanges.php | 3 +++ includes/api/ApiQueryWatchlist.php | 3 +++ 2 files changed, 6 insertions(+) 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'" ); } } -- 2.20.1