function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
$start_msg, $where, $what) {
global $checkall,
- $color, $msgs, $msort,
+ $color, $msgs, $msort, $td_str, $msg,
$default_use_priority,
$message_highlight_list,
$index_order,
}
}
-
- $subject = processSubject(decodeHeader($msg['SUBJECT']), $indent_array[$msg['ID']]);
+ $subject_full = decodeHeader($msg['SUBJECT']);
+ $subject = processSubject($subject_full, $indent_array[$msg['ID']]);
echo html_tag( 'tr','','','','VALIGN="top"') . "\n";
. '&passed_id='. $msg["ID"]
. '&startMessage='.$start_msg.$searchstr.'"';
do_hook("subject_link");
- if ($subject != $msg['SUBJECT']) {
+ if ($subject != $subject_full) {
$title = get_html_translation_table(HTML_SPECIALCHARS);
$title = array_flip($title);
- $title = strtr($msg['SUBJECT'], $title);
+ $title = strtr($subject_full, $title);
$title = str_replace('"', "''", $title);
$td_str .= " title=\"$title\"";
}
if (!$stuff) {
$td_str .= ' ';
}
+ do_hook("msg_envelope");
$td_str .= '</small></b>';
echo html_tag( 'td',
$td_str,
$end_loop = $show_num;
}
}
- $msgs = fillMessageArray($imapConnection,$id,$end_loop, $mailbox);
+ $msgs = fillMessageArray($imapConnection,$id,$end_loop);
}
return $msgs;
}
global $msgs, $msort, $auto_expunge, $thread_sort_messages,
$allow_server_sort, $server_sort_order;
+ /*
+ * For some reason, on PHP 4.3+, this being unset, and set in the session causes havoc
+ * so setting it to an empty array beforehand seems to clean up the issue, and stopping the
+ * "Your script possibly relies on a session side-effect which existed until PHP 4.2.3" error
+ */
+
+ if (!isset($msort)) {
+ $msort = array();
+ }
+
+ if (!isset($msgs)) {
+ $msgs = array();
+ }
+
$start = microtime();
/* If autoexpunge is turned on, then do it now. */
$mbxresponse = sqimap_mailbox_select($imapConnection, $mailbox);
mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str, $color);
echo '</td></tr></table>';
$t = elapsed($start);
- echo("elapsed time = $t seconds\n");
+ //echo("elapsed time = $t seconds\n");
}
function calc_msort($msgs, $sort) {
if (strlen($subject) <= $trim_at)
return $subject;
- $ent_strlen = strlen($subject);
+ $ent_strlen = $orig_len = strlen($subject);
$trim_val = $trim_at - 5;
$ent_offset = 0;
/*
* see if this is entities-encoded string
* If so, Iterate through the whole string, find out
* the real number of characters, and if more
- * than 55, substr with an updated trim value.
+ * than 55, substr with an updated trim value.
*/
-
- 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;
+ $step = $ent_loc = 0;
+ while ( $ent_loc < $trim_val && (($ent_loc = strpos($subject, '&', $ent_offset)) !== false) &&
+ (($ent_loc_end = strpos($subject, ';', $ent_loc+3)) !== false) ) {
+ $trim_val += ($ent_loc_end-$ent_loc);
$ent_offset = $ent_loc_end+1;
+ ++$step;
+ }
+
+ if (($trim_val > 50) && (strlen($subject) > ($trim_val))&& (strpos($subject,';',$trim_val) < ($trim_val +6))) {
+ $i = strpos($subject,';',$trim_val);
+ if ($i) {
+ $trim_val = strpos($subject,';',$trim_val);
+ }
}
-
if ($ent_strlen <= $trim_at){
return $subject;
}
function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
return $languages[$squirrelmail_language]['XTRA_CODE']('strimwidth', $subject, $trim_val);
}
-
return substr($subject, 0, $trim_val) . '...';
}