Index: branches/5.0.x/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r12877 -r13198 --- branches/5.0.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 12877) +++ branches/5.0.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 13198) @@ -1,6 +1,6 @@ SelectParam($params,'first_chars,cut_first'); + if ($first_chars) { - $needs_cut = mb_strlen($value) > $first_chars; - $value = mb_substr($value, 0, $first_chars); - if ($needs_cut) $value .= ' ...'; + $stripped_value = strip_tags($value, $this->SelectParam($params, 'allowed_tags')); + + if (mb_strlen($stripped_value) > $first_chars) { + $value = mb_substr($stripped_value, 0, $first_chars) . ' ...'; + } } if (array_key_exists('nl2br', $params) && $params['nl2br']) { @@ -1673,11 +1676,14 @@ $title .= ' - '.$params['group_title']; } - $cut_first = array_key_exists('cut_first', $params) && $params['cut_first']; + $first_chars = $this->SelectParam($params, 'first_chars,cut_first'); - if ($cut_first && mb_strlen($title) > $cut_first) { - if (!preg_match('/(.*)<\/a>/',$title)) { - $title = mb_substr($title, 0, $cut_first).' ...'; + if ($first_chars && !preg_match('/(.*)<\/a>/', $title)) { + // don't cut titles, that contain phrase translation links + $stripped_title = strip_tags($title, $this->SelectParam($params, 'allowed_tags')); + + if (mb_strlen($stripped_title) > $first_chars) { + $title = mb_substr($stripped_title, 0, $first_chars) . ' ...'; } }