format_tags_string: improve detection of layout breaking extra-long tag strings

This commit is contained in:
Andrew Dolgov 2009-10-06 13:08:37 +04:00
parent ab553f9ac5
commit 275a0af23d
1 changed files with 7 additions and 1 deletions

View File

@ -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);
if ($num_tags == $tag_limit) {
$tmp_tags_str = implode(", ", $formatted_tags);
if ($num_tags == $tag_limit || mb_strlen($tmp_tags_str) > 150) {
break;
}
}