Skip to content

Commit 403c911

Browse files
viettruongqsammarshallou
viettruongq
authored andcommitted
M4: Blog: Tag text size is wrong #627983
1 parent 6f3e807 commit 403c911

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

locallib.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,13 +1114,13 @@ function oublog_get_tags($oublog, $groupid, $cm, $oubloginstanceid=null, $indivi
11141114
$sql = $sql . ' LIMIT ' . $limit;
11151115
}
11161116
if ($tags = $DB->get_records_sql($sql, $params)) {
1117-
$first = array_shift($tags);
1118-
$max = $first->count;
1119-
array_unshift($tags, $first);
1117+
$max = max(array_map(function($tag) {
1118+
return $tag->count;
1119+
}, $tags));
11201120

1121-
$last = array_pop($tags);
1122-
$min = $last->count;
1123-
array_push($tags, $last);
1121+
$min = min(array_map(function($tag) {
1122+
return $tag->count;
1123+
}, $tags));
11241124

11251125
$delta = $max-$min+0.00000001;
11261126

0 commit comments

Comments
 (0)