summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-10-06 13:08:37 +0400
committerAndrew Dolgov <[email protected]>2009-10-06 13:08:37 +0400
commit275a0af23de1cc679b5c4938fe5a41abcbf5a3a9 (patch)
tree067b89dd4f522200ae6ec83a129c585e947e1bf2 /functions.php
parentab553f9ac5291699be480dd467fbd8a0b8aebc76 (diff)
format_tags_string: improve detection of layout breaking extra-long tag strings
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/functions.php b/functions.php
index 32a5b2ec3..b67ff9570 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 = "<a href=\"javascript:viewfeed('$tag_escaped')\">$tag</a>";
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;
}
}