X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fmime.php;h=f3dc3ad46c4fd27ea98d735e0ce9f8496dc5b0c7;hp=74153d77ce8bdd9c65908134b7af1af18a679837;hb=472e7acbb50c8496ec9ae730bb82d785add1ed96;hpb=0b0225e28659e2e36ac706059a16097b58b93bb0
diff --git a/functions/mime.php b/functions/mime.php
index 74153d77..f3dc3ad4 100644
--- a/functions/mime.php
+++ b/functions/mime.php
@@ -3,7 +3,7 @@
/**
* mime.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 contains the functions necessary to detect and decode MIME
@@ -12,12 +12,12 @@
* $Id$
*/
-require_once('../functions/imap.php');
-require_once('../functions/attachment_common.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/attachment_common.php');
-/* --------------------------------------------------------------------------------- */
-/* MIME DECODING */
-/* --------------------------------------------------------------------------------- */
+/* -------------------------------------------------------------------------- */
+/* MIME DECODING */
+/* -------------------------------------------------------------------------- */
/* This function gets the structure of a message and stores it in the "message" class.
* It will return this object for use with all relevant header information and
@@ -26,51 +26,64 @@ require_once('../functions/attachment_common.php');
function mime_structure ($bodystructure, $flags=array()) {
- // isolate the body structure and remove beginning and end parenthesis
+ /* Isolate the body structure and remove beginning and end parenthesis. */
$read = trim(substr ($bodystructure, strpos(strtolower($bodystructure), 'bodystructure') + 13));
- $msg = &new message();
$read = trim(substr ($read, 0, -1));
- $msg = $msg->parseStructure($read,0);
- $msg->setEnt('0');
+ $i = 0;
+ $msg = Message::parseStructure($read,$i);
+ if (!is_object($msg)) {
+ include_once(SM_PATH . 'functions/display_messages.php');
+ global $color, $mailbox;
+ /* removed urldecode because $_GET is auto urldecoded ??? */
+ displayPageHeader( $color, $mailbox );
+ $errormessage = _("SquirrelMail could not decode the bodystructure of the message");
+ $errormessage .= '
'._("the provided bodystructure by your imap-server").':
';
+ $errormessage .= '
' . htmlspecialchars($read) . ''; + plain_error_message( $errormessage, $color ); + echo '