Use Horde_String::truncate()
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 24 Jul 2009 21:55:10 +0000 (15:55 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sat, 25 Jul 2009 16:47:20 +0000 (10:47 -0600)
imp/lib/Compose.php
imp/lib/Contents.php

index cc39f44..c03ac33 100644 (file)
@@ -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 {
index 108e1cd..196f1f6 100644 (file)
@@ -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);