For other languages should be using multibyte string functions, otherwise 'Limit titles to a specific length' is halved

function _clickpath_truncate_title($title) {
  $length = variable_get('clickpath_title_length', 20);
  if ($length > 0 && mb_strlen($title) > $length) {
    $title = mb_substr($title, 0, $length) . '…';
  }
  return $title;
}
CommentFileSizeAuthor
#2 quickfix-1199950-0.patch1.16 KBchi

Comments

alexbk66-’s picture

Title: 'Limit titles to a specific length' is halved for other languages » 'Limit titles to a specific length' is halved for languages using multibyte strings

Actually, there are drupal_strlen and drupal_substr functions:

function _clickpath_truncate_title($title) {
  $length = variable_get('clickpath_title_length', 20);
  if ($length > 0 && drupal_strlen($title) > $length) {
    $title = drupal_substr  ($title, 0, $length) . '…';
  }
  return $title;
}
chi’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Active » Needs review
Issue tags: +needs backport to 6.x
StatusFileSize
new1.16 KB

Here the patch. I've also removed ellipsis from breadcrumb.

romansta’s picture

Works for me . It is a german site.