]> git.wh0rd.org Git - tt-rss.git/commitdiff
format_tags_string: improve detection of layout breaking extra-long tag strings
authorAndrew Dolgov <fox@bah.org.ru>
Tue, 6 Oct 2009 09:08:37 +0000 (13:08 +0400)
committerAndrew Dolgov <fox@bah.org.ru>
Tue, 6 Oct 2009 09:08:37 +0000 (13:08 +0400)
functions.php

index 32a5b2ec3d6a5c8b1516f5635a8e66d8fd104576..b67ff95703ac833dff333a68206d6f80fe754769 100644 (file)
                        $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;
                        }
                }