MDL-31360 use extra param in get_in_or_equal - one less line of code...
authorDan Marsden <dan@danmarsden.com>
Wed, 1 Feb 2012 10:09:49 +0000 (23:09 +1300)
committerDan Marsden <dan@danmarsden.com>
Wed, 1 Feb 2012 10:11:03 +0000 (23:11 +1300)
lib/accesslib.php

index ed61a9e..9ca574d 100644 (file)
@@ -6391,10 +6391,9 @@ class context_module extends context {
 
         $extracaps = array_merge($subcaps, $extracaps);
         $extra = '';
-        $params = array();
-        if (!empty($extracaps)) {
-            list($extra, $params) = $DB->get_in_or_equal(
-                $extracaps, SQL_PARAMS_NAMED, 'cap0');
+        list($extra, $params) = $DB->get_in_or_equal(
+            $extracaps, SQL_PARAMS_NAMED, 'cap0', true, '');
+        if (!empty($extra)) {
             $extra = "OR name $extra";
         }
         $sql = "SELECT *