From: Andrew Dolgov Date: Tue, 6 Oct 2009 09:08:37 +0000 (+0400) Subject: format_tags_string: improve detection of layout breaking extra-long tag strings X-Git-Tag: 1.3.4~40 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=275a0af23de1cc679b5c4938fe5a41abcbf5a3a9;p=tt-rss.git format_tags_string: improve detection of layout breaking extra-long tag strings --- diff --git a/functions.php b/functions.php index 32a5b2ec..b67ff957 100644 --- a/functions.php +++ b/functions.php @@ -6158,11 +6158,17 @@ $num_tags++; $tag_escaped = str_replace("'", "\\'", $tag); + if (mb_strlen($tag) > 30) { + $tag = truncate_string($tag, 30); + } + $tag_str = "$tag"; array_push($formatted_tags, $tag_str); + + $tmp_tags_str = implode(", ", $formatted_tags); - if ($num_tags == $tag_limit) { + if ($num_tags == $tag_limit || mb_strlen($tmp_tags_str) > 150) { break; } }