浏览代码

Fix that frequently subjects were displayed ending in ... even though nothing
was trimmed.

Thijs Kinkhorst 22 年之前
父节点
当前提交
7e05ef9cbe
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      functions/mailbox_display.php

+ 7 - 1
functions/mailbox_display.php

@@ -1221,7 +1221,13 @@ function processSubject($subject, $threadlevel = 0) {
         function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
         return $languages[$squirrelmail_language]['XTRA_CODE']('strimwidth', $subject, $trim_val);
     }
-    return substr($subject, 0, $trim_val) . '...';
+
+    // only print '...' when we're actually dropping part of the subject
+    if(strlen($subject) < $trim_val) {
+        return $subject;
+    } else {
+        return substr($subject, 0, $trim_val) . '...';
+    }
 }
 
 function getMbxList($imapConnection) {