more diagnostics in has_capability() - number instead of context object detected and debug message displayed

This commit is contained in:
skodak 2006-10-02 22:10:36 +00:00
parent 403ba37a35
commit 5fe9a11d96

View File

@ -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