Changeset 2739


Ignore:
Timestamp:
05/07/10 16:53:31 (14 years ago)
Author:
niltonneto
Message:

Ticket #1066 - Correção de problema durante leitura de mensagem sem multipart.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r2731 r2739  
    801801                        } 
    802802 
    803                         $content = $this->decodeBody( 
    804                                 imap_body( $this -> mbox, $msg_number, FT_UID ), 
    805                                 $msg -> encoding[ $msg_number ][ 0 ], 
    806                                 $msg -> charset[ $msg_number ][ 0 ] 
    807                         ); 
    808  
    809                         if ( strtolower( $msg -> structure[ $msg_number ] -> subtype ) == 'plain' ) 
    810                         { 
    811                                 $content = str_replace( array( '<', '>' ), array( ' #$<$# ', ' #$>$# ' ), $content ); 
    812                                 $content = nl2br( htmlentities( $content ) ); 
    813                                 $content = $this -> replace_links( $content ); 
    814                                 $content = str_replace( array( ' #$&lt;$# ', ' #$&gt;$# ' ), array( '&lt;', '&gt;' ), $content ); 
    815                                 $content = '<span style="font-family: monospace">' . $content . '</span>'; 
    816  
    817                                 $return[ 'body' ] = $content; 
    818  
    819                                 return $return; 
     803                        $content = ''; 
     804                        // If simple message is subtype 'html' or 'plain', then get content body. 
     805                        if(strtolower($msg->structure[$msg_number]->subtype) == "html" ||  
     806                                strtolower( $msg -> structure[ $msg_number ] -> subtype ) == 'plain'){ 
     807 
     808                                $content = $this->decodeBody( 
     809                                        imap_body( $this -> mbox, $msg_number, FT_UID ), 
     810                                        $msg -> encoding[ $msg_number ][ 0 ], 
     811                                        $msg -> charset[ $msg_number ][ 0 ] 
     812                                ); 
     813         
     814                                if ( strtolower( $msg -> structure[ $msg_number ] -> subtype ) == 'plain' ) 
     815                                { 
     816                                        $content = str_replace( array( '<', '>' ), array( ' #$<$# ', ' #$>$# ' ), $content ); 
     817                                        $content = nl2br( htmlentities( $content ) ); 
     818                                        $content = $this -> replace_links( $content ); 
     819                                        $content = str_replace( array( ' #$&lt;$# ', ' #$&gt;$# ' ), array( '&lt;', '&gt;' ), $content ); 
     820                                        $content = '<span style="font-family: monospace">' . $content . '</span>'; 
     821         
     822                                        $return[ 'body' ] = $content; 
     823         
     824                                        return $return; 
     825                                } 
    820826                        } 
    821827                } 
Note: See TracChangeset for help on using the changeset viewer.