Changeset 2781
- Timestamp:
- 05/14/10 11:14:07 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r2777 r2781 818 818 { 819 819 $content = str_replace( array( '<', '>' ), array( ' #$<$# ', ' #$>$# ' ), $content ); 820 $content = nl2br( htmlentities( $content ));820 $content = htmlentities( $content ); 821 821 $content = $this -> replace_links( $content ); 822 822 $content = str_replace( array( ' #$<$# ', ' #$>$# ' ), array( '<', '>' ), $content ); 823 $content = '< span style="font-family: monospace">' . $content . '</span>';824 823 $content = '<pre style="font-family: monospace">' . $content . '</pre>'; 824 825 825 $return[ 'body' ] = $content; 826 826 827 827 return $return; 828 828 } 829 829 } 830 830 } 831 else 831 else 832 832 { //Complicated message, multiple parts 833 833 $html_body = ''; … … 835 835 $has_multipart = true; 836 836 $this->has_cid = false; 837 837 838 838 if (strtolower($msg->structure[$msg_number]->subtype) == "related") 839 839 $this->has_cid = true; 840 840 841 841 if (strtolower($msg->structure[$msg_number]->subtype) == "alternative") { 842 842 $show_only_html = false; … … 844 844 $file_type = strtolower($msg->file_type[$msg_number][$values]); 845 845 if($file_type == "text/html") 846 $show_only_html = true; 846 $show_only_html = true; 847 847 } 848 848 } … … 852 852 foreach($msg->pid[$msg_number] as $values => $msg_part) 853 853 { 854 855 $file_type = strtolower($msg->file_type[$msg_number][$values]); 854 $file_type = strtolower($msg->file_type[$msg_number][$values]); 856 855 if($file_type == "message/rfc822" || $file_type == "multipart/alternative") 857 856 { … … 864 863 } 865 864 } 866 867 if(($file_type == "text/plain" 865 866 if(($file_type == "text/plain" 868 867 || $file_type == "text/html") 869 868 && $file_type != 'attachment') 870 { 869 { 871 870 if($file_type == "text/plain" && !$show_only_html && $has_multipart) 872 871 { 873 872 // if TXT file size > 100kb, then it will not expand. 874 873 if(!($file_type == "text/plain" && $msg->fsize[$msg_number][$values] > 102400)) { 875 $content .= nl2br(htmlentities($this->decodeBody(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]))); 874 $content .= htmlentities($this->decodeBody(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values])); 875 $content = '<pre style="font-family: monospace">' . $content . '</pre>'; 876 876 } 877 877 } … … 879 879 else if($file_type == "text/html" && $msg->fsize[$msg_number][$values] < 307200) 880 880 { 881 $content .= $this->decodeBody(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]); 881 $content .= $this->decodeBody(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]); 882 882 $show_only_html = true; 883 883 } 884 884 885 } 885 886 else if($file_type == "message/delivery-status" || $file_type == "message/feedback-report"){ 886 887 $content .= "<hr align='left' width='95%' style='border:1px solid #DCDCDC'>"; 887 $content .= nl2br($this->decodeBody(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values])); 888 $content .= $this->decodeBody(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]); 889 $content = '<pre style="font-family: monospace">' . $content . '</pre>'; 888 890 889 891 } 890 892 else if($file_type == "message/rfc822" || $file_type == "text/rfc822-headers"){ 891 893 892 894 include_once("class.imap_attachment.inc.php"); 893 895 $att = new imap_attachment(); … … 946 948 { 947 949 $body = str_replace( array( '<', '>' ), array( ' #$<$# ', ' #$>$# ' ), $body ); 948 $body = nl2br( htmlentities( $body ));950 $body = htmlentities( $body ); 949 951 $body = $this -> replace_links( $body ); 950 952 $body = str_replace( array( ' #$<$# ', ' #$>$# ' ), array( '<', '>' ), $body ); 951 $body = '< span style="font-family: monospace">' . $body . '</span>';953 $body = '<pre style="font-family: monospace">' . $body . '</pre>'; 952 954 } 953 955
Note: See TracChangeset
for help on using the changeset viewer.