From: Michael M Slusarz Date: Fri, 24 Jul 2009 21:55:10 +0000 (-0600) Subject: Use Horde_String::truncate() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=52502da2f7f0206e9ab7d10c54a9fd4b64aa93af;p=horde.git Use Horde_String::truncate() --- diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index cc39f4433..c03ac338d 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -1488,8 +1488,8 @@ class IMP_Compose if ($attached == 1) { if (!($name = $headerob->getValue('subject'))) { $name = _("[No Subject]"); - } elseif (Horde_String::length($name) > 80) { - $name = Horde_String::substr($name, 0, 80) . '...'; + } else { + $name = Horde_String::truncate($name, 80); } return 'Fwd: ' . $GLOBALS['imp_imap']->ob->utils->getBaseSubject($name, array('keepblob' => true)); } else { diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 108e1cd86..196f1f616 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -513,7 +513,7 @@ class IMP_Contents $this->_build = $oldbuild; if (Horde_String::length($ptext) > $maxlen) { - return array('cut' => true, 'text' => Horde_String::substr($ptext, 0, $maxlen) . ' ...'); + return array('cut' => true, 'text' => Horde_String::truncate($ptext, $maxlen)); } return array('cut' => false, 'text' => $ptext);