From 553baa8f764b96f87bf9b6dbf437752103f7ffb1 Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Fri, 4 Dec 2009 03:06:03 +0000 Subject: [PATCH] "MDL-20819, sometimes, modules return non-array which can break stats processing, added more error checking, merged from 1.9" --- lib/statslib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/statslib.php b/lib/statslib.php index e175e7087b..ab031171a5 100644 --- a/lib/statslib.php +++ b/lib/statslib.php @@ -1287,7 +1287,10 @@ function stats_get_action_names($str) { require_once($file); $function = $mod->name.'_get_'.$str.'_actions'; if (function_exists($function)) { - $actions = array_merge($actions,$function()); + $mod_actions = $function(); + if (is_array($mod_actions)) { + $actions = array_merge($actions, $mod_actions); + } } } -- 2.39.5