From 969761e440c1c1b6c86f60c1f8f988e6fe4a36cc Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 27 Oct 2008 12:16:47 +0000 Subject: [PATCH] API: Also throw a warning when tokens for missing pages are denied --- includes/api/ApiQueryInfo.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index e8b35633db..fbea988ba2 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -480,7 +480,9 @@ class ApiQueryInfo extends ApiQueryBase { foreach($params['token'] as $t) { $val = call_user_func($tokenFunctions[$t], $pageid, $title); - if($val !== false) + if($val === false) + $this->setWarning("Action '$t' is not allowed for the current user"); + else $res['query']['pages'][$pageid][$t . 'token'] = $val; } } -- 2.20.1