From 403c9110006578c1ba8b43b4586e4c7bfa7106d7 Mon Sep 17 00:00:00 2001 From: viettruongq Date: Wed, 7 Dec 2022 11:03:57 +0700 Subject: [PATCH] M4: Blog: Tag text size is wrong #627983 --- locallib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locallib.php b/locallib.php index 4301259..5f706fd 100644 --- a/locallib.php +++ b/locallib.php @@ -1114,13 +1114,13 @@ function oublog_get_tags($oublog, $groupid, $cm, $oubloginstanceid=null, $indivi $sql = $sql . ' LIMIT ' . $limit; } if ($tags = $DB->get_records_sql($sql, $params)) { - $first = array_shift($tags); - $max = $first->count; - array_unshift($tags, $first); + $max = max(array_map(function($tag) { + return $tag->count; + }, $tags)); - $last = array_pop($tags); - $min = $last->count; - array_push($tags, $last); + $min = min(array_map(function($tag) { + return $tag->count; + }, $tags)); $delta = $max-$min+0.00000001;