From 5fe9a11d96451cc07b8270e2fe1bbde2069f587f Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 2 Oct 2006 22:10:36 +0000 Subject: [PATCH] more diagnostics in has_capability() - number instead of context object detected and debug message displayed --- lib/accesslib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/accesslib.php b/lib/accesslib.php index c1567fb8768..f45a01adcd9 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -306,6 +306,10 @@ function has_capability($capability, $context=NULL, $userid=NULL, $doanything=tr } } + if (!is_object($context)) { + debugging('Incorrect context parameter "'.$context.'" for has_capability(), object expected! This should be fixed in code.'); + } + if ($doanything) { // Check site