/**
* imap_messages.php
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This implements functions that manipulate messages
if (($move_to_trash == true) && (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder))) {
$read = sqimap_run_command ($imap_stream, "COPY $msgs_id \"$trash_folder\"", true, $response, $message, $uid_support);
}
- $read = sqimap_run_command ($imap_stream, "STORE $msgs_id +FLAGS (\\Deleted)", $handle_errors, $response, $message, $uid_support);
+ $read = sqimap_run_command ($imap_stream, "STORE $msgs_id +FLAGS (\\Deleted)", true, $response, $message, $uid_support);
}
*/
function sqimap_message_list_squisher($messages_array) {
if( !is_array( $messages_array ) ) {
- return;
+ return $messages_array;
}
sort($messages_array, SORT_NUMERIC);
_("ERROR : Could not complete request.") .
'</b><br>' .
_("Unknown response from IMAP server: ") . ' 1.' .
- $r[0] . "</font><br>\n";
+ htmlspecialchars($r[0]) . "</font><br>\n";
} else if (! isset($id2index[$regs[1]]) || !count($id2index[$regs[1]])) {
set_up_language($squirrelmail_language);
echo '<br><b><font color=$color[2]>' .
_("ERROR : Could not complete request.") .
'</b><br>' .
_("Unknown message number in reply from server: ") .
- $regs[1] . "</font><br>\n";
+ htmlspecialchars($regs[1]) . "</font><br>\n";
} else {
$read_list[$id2index[$regs[1]]] = $r;
}
_("ERROR : Could not complete request.") .
'</b><br>' .
_("Unknown response from IMAP server: ") . ' 1.' .
- $r[0] . "</font><br>\n";
+ htmlspecialchars($r[0]) . "</font><br>\n";
} else if (! isset($id2index[$regs[2]]) || !count($id2index[$regs[2]])) {
set_up_language($squirrelmail_language);
echo '<br><b><font color=$color[2]>' .
_("ERROR : Could not complete request.") .
'</b><br>' .
_("Unknown message number in reply from server: ") .
- $regs[2] . "</font><br>\n";
+ htmlspecialchars($regs[2]) . "</font><br>\n";
} else {
$read_list[$id2index[$regs[2]]] = $r;
$unique_id = $regs[2];
$subject = _("(no subject)");
$from = _("Unknown Sender");
$priority = 0;
- $messageid = "<>";
- $cc = "";
- $to = "";
- $date = "";
- $type[0] = "";
- $type[1] = "";
- $inrepto = "";
+ $messageid = '<>';
+ $cc = '';
+ $to = '';
+ $date = '';
+ $type[0] = '';
+ $type[1] = '';
+ $inrepto = '';
$flag_seen = false;
$flag_answered = false;
$flag_deleted = false;
foreach ($read as $read_part) {
//unfold multi-line headers
- if ($prevline && strpos($read_part, "\t ") === true) {
- $read_part = substr($prevline, 0, -2) . preg_replace('/(\t\s+)/',' ',$read_part);
- }
+ if ($prevline && strpos($read_part, "\t ") === true) {
+ $read_part = substr($prevline, 0, -2) . preg_replace('/(\t\s+)/',' ',$read_part);
+ }
$prevline = $read_part;
if ($read_part{0} == '*') {
if ($internaldate) {
$tmpdate = str_replace(' ',' ',$tmpdate);
$tmpdate = explode(' ',$tmpdate);
$date = str_replace('-',' ',$tmpdate[0]) . " " .
- $tmpdate[1] . " " .
+ $tmpdate[1] . ' ' .
$tmpdate[2];
}
}
$unique_id = $reg[1];
}
} else {
- $firstchar = $read_part{0};
+ $firstchar = strtoupper($read_part{0});
if ($firstchar == 'T') {
$regpattern = $patterns[0];
$id = 1;