MDL-31876 questionlib: fix question_has_capability_on memory bloat

This commit is contained in:
Gootvilig David Hai
2012-03-06 21:31:55 +01:00
committed by Eloy Lafuente (stronk7)
parent a9b03dc661
commit 8d11716bfc
+1 -1
View File
@@ -1306,7 +1306,7 @@ function question_has_capability_on($question, $cap, $cachecat = -1) {
static $categories = array();
static $cachedcat = array();
if ($cachecat != -1 && array_search($cachecat, $cachedcat) === false) {
$questions += $DB->get_records('question', array('category' => $cachecat));
$questions += $DB->get_records('question', array('category' => $cachecat), '', 'id,category,createdby');
$cachedcat[] = $cachecat;
}
if (!is_object($question)) {