Use Horde_String::truncate().
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Jul 2009 22:54:40 +0000 (16:54 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 13 Jul 2009 19:47:00 +0000 (13:47 -0600)
imp/compose-dimp.php
imp/search.php

index 3156133..2457160 100644 (file)
@@ -177,10 +177,7 @@ if (count($_POST)) {
         }
 
         if ($sent && $prefs->getValue('compose_confirm')) {
-            $notify_text = (Horde_String::length($header['subject']) > 100)
-                ? Horde_String::substr($header['subject'], 0, 100) . ' ...'
-                : $header['subject'];
-            $notification->push(empty($header['subject']) ? _("Message sent successfully.") : sprintf(_("Message \"%s\" sent successfully."), $notify_text), 'horde.success');
+            $notification->push(empty($header['subject']) ? _("Message sent successfully.") : sprintf(_("Message \"%s\" sent successfully."), Horde_String::truncate($header['subject'])), 'horde.success');
         }
 
         /* Update maillog information. */
index b87d674..64cdfc2 100644 (file)
@@ -172,10 +172,7 @@ $saved_searches = $imp_search->getSearchQueries();
 if (!empty($saved_searches)) {
     $ss = array();
     foreach ($saved_searches as $key => $val) {
-        if (Horde_String::length($val) > 100) {
-            $val = Horde_String::substr($val, 0, 100) . ' ...';
-        }
-        $ss[] = array('val' => htmlspecialchars($key), 'text' => htmlspecialchars($val));
+        $ss[] = array('val' => htmlspecialchars($key), 'text' => htmlspecialchars(Horde_String::truncate($val)));
     }
     $t->set('saved_searches', $ss);
 }