Use Horde_String::truncate()
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 15 Aug 2009 20:03:59 +0000 (14:03 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sat, 15 Aug 2009 20:06:24 +0000 (14:06 -0600)
chora/browsedir.php

index 4da275b..1de3b32 100644 (file)
@@ -118,10 +118,7 @@ if ($fileList) {
         $url = Chora::url('browsefile', $fileName, array('onb' => $onb));
         $readableDate = Chora::readableTime($date);
         if ($log) {
-            $shortLog = str_replace("\n", ' ', trim(substr($log, 0, $conf['options']['shortLogLength'] - 1)));
-            if (strlen($log) > 80) {
-                $shortLog .= '...';
-            }
+            $shortLog = Horde_String::truncate(str_replace("\n", ' ', trim($log)), $conf['options']['shortLogLength']);
         }
         require CHORA_TEMPLATES . '/directory/file.inc';
     }