From: kink Date: Thu, 27 Feb 2003 18:58:10 +0000 (+0000) Subject: Only add extra "points" for a subject with entities when the entities are X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c2f884176a3ad12ccac9368cf11e6ff9e54d92e6;p=squirrelmail.git Only add extra "points" for a subject with entities when the entities are within the remaining range after trimming. This prevents entities at the end which are cut off anyway to influence the cut-off-point for the subject. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4563 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 1d04af2a..d0b67efa 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -1121,7 +1121,7 @@ function processSubject($subject, $threadlevel = 0) { $trim_at = 55; - /* if this is threaded, substract two chars per indentlevel */ + /* if this is threaded, subtract two chars per indentlevel */ if($threadlevel > 0 && $threadlevel <= 10) $trim_at -= (2*$threadlevel); @@ -1137,8 +1137,9 @@ function processSubject($subject, $threadlevel = 0) { * the real number of characters, and if more * than 55, substr with an updated trim value. */ - while ( (($ent_loc = strpos($subject, '&', $ent_offset)) !== false) && - (($ent_loc_end = strpos($subject, ';', $ent_loc)) !== false) ) { + + while ( (($ent_loc = strpos(substr($subject,0,$trim_val), '&', $ent_offset)) !== false) && + (($ent_loc_end = strpos(substr($subject,0,$trim_val+5), ';', $ent_loc)) !== false) ) { $trim_val += ($ent_loc_end-$ent_loc)+1; $ent_strlen -= $ent_loc_end-$ent_loc; $ent_offset = $ent_loc_end+1;