X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmime.php;h=74dd9258d1d25ac2c39710b7ded9d5e8a5e6ffc0;hb=174a32e0b5afca8b1bae89d7e1b81fba1bfbc339;hp=aacc7268f47f126ad83f2a0159a4aced13cb419c;hpb=ae3fac8dab1e33dc841922b522a9027bd45f6c32;p=squirrelmail.git diff --git a/functions/mime.php b/functions/mime.php index aacc7268..74dd9258 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -12,6 +12,7 @@ define('mime_php', true); require_once('../functions/imap.php'); + require_once('../functions/attachment_common.php'); /** Setting up the objects that have the structure for the message **/ @@ -24,6 +25,7 @@ var $cc = array(), $bcc = array(), $reply_to = '', $subject = ''; var $id = 0, $mailbox = '', $description = '', $filename = ''; var $entity_id = 0, $message_id = 0, $name = ''; + // var $priority = ""; } class message { @@ -405,15 +407,32 @@ } else if (ereg('"([^"]*)"', $topline, $regs)) { $ret = $regs[1]; } else { - $ret = "Body retrieval error. Please report this bug!\n" . - "Response: $response\n" . - "Message: $message\n" . - "FETCH line: $topline" . - "---------------\n$wholemessage"; - - foreach ($data as $d) { - $ret .= htmlspecialchars($d) . "\n"; + global $where, $what, $mailbox, $passed_id, $startMessage; + $par = "mailbox=".urlencode($mailbox)."&passed_id=$passed_id"; + if (isset($where) && isset($what)) { + $par .= "&where=".urlencode($where)."&what=".urlencode($what); + } else { + $par .= "&startMessage=$startMessage&show_more=0"; } + $par .= '&response='.urlencode($response).'&message='.urlencode($message). + '&topline='.urlencode($topline); + + echo 'Body retrieval error. The reason for this is most probably that
' . + 'the message is malformed. Please help us making future versions
' . + "better by submitting this message to the developers knowledgebase!
\n" . + "Submit message
" . + + "Response: $response
" . + "Message: $message
" . + "FETCH line: $topline
"; + + fputs ($imap_stream, "$sid FETCH $passed_id BODY[]\r\n"); + $data = sqimap_read_data ($imap_stream, $sid, true, $response, $message); + array_shift($data); + $wholemessage = implode('', $data); + + $ret = "---------------\n$wholemessage"; + } return( $ret ); } @@ -874,7 +893,7 @@ $style .= $body{$i}; $i++; } - stripComments( &$i, $j, &$body ); + stripComments( $i, $j, $body ); $style = strtoupper( trim( $style ) ); if( $style == 'BODY' ) { // Next we look into the definitions of the body style @@ -903,7 +922,7 @@ } $styleblk .= $body{$i}; } - stripComments( &$i, $j, &$body ); + stripComments( $i, $j, $body ); if( $body{$i} <> '>' ) $i++; } @@ -915,6 +934,8 @@ $ret .= '' . _("Title:") . " $title
\n"; $ret .= " '' ) $ret .= " bgcolor=$bgcolor"; @@ -952,6 +973,8 @@ default: // Following tags can contain some event handler, lets search it stripComments( $i, $j, $body ); + if (! isset($base)) + $base = ''; $ret .= stripEvent( $i, $j, $body, $id, $base ) . '>'; // $ret .= ""; } @@ -1113,4 +1136,4 @@ return( $ret ); } -?> \ No newline at end of file +?>