From b69a13a4d20bdca8f26831e005d4491ada7a0787 Mon Sep 17 00:00:00 2001 From: kink Date: Sun, 8 Jun 2003 12:39:49 +0000 Subject: [PATCH] Fix this awfully ugly error message, finally. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4976 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 369a00ed..8eec107f 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -759,14 +759,20 @@ function sqimap_get_message ($imap_stream, $id, $mailbox) { $flags = array(); $read = sqimap_run_command ($imap_stream, "FETCH $id (FLAGS BODYSTRUCTURE)", true, $response, $message, $uid_support); if ($read) { - if (preg_match('/.+FLAGS\s\((.*)\)\s/AUi',$read[0],$regs)) { - if (trim($regs[1])) { - $flags = preg_split('/ /', $regs[1],-1,'PREG_SPLIT_NI_EMPTY'); - } - } + if (preg_match('/.+FLAGS\s\((.*)\)\s/AUi',$read[0],$regs)) { + if (trim($regs[1])) { + $flags = preg_split('/ /', $regs[1],-1,'PREG_SPLIT_NI_EMPTY'); + } + } } else { - echo "ERROR Yeah I know, not a very usefull errormessage (id = $id, mailbox = $mailbox sqimap_get_message)"; - exit; + /* the message was not found, maybe the mailbox was modified? */ + global $sort, $startMessage, $color; + + $errmessage = _("The server couldn't find the message you requested.") . + '

'._("Most probably your message list was out of date and the message has been moved away or deleted (perhaps by another program accessing the same mailbox)."); + /* this will include a link back to the message list */ + error_message($errmessage, $mailbox, $sort, $startMessage, $color); + exit; } $bodystructure = implode('',$read); $msg = mime_structure($bodystructure,$flags); -- 2.25.1