From: <sy...@us...> - 2007-09-21 20:00:36
|
Update of /cvsroot/tikiwiki/tiki/lib In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv2167/lib Modified Files: commentslib.php Log Message: [FIX]outbound forum: body of html message without txt alternative were lost + body of html messages with attachment was lost in some case Index: commentslib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/commentslib.php,v retrieving revision 1.164 retrieving revision 1.165 diff -u -d -r1.164 -r1.165 --- commentslib.php 23 Aug 2007 10:36:44 -0000 1.164 +++ commentslib.php 21 Sep 2007 20:00:29 -0000 1.165 @@ -372,9 +372,7 @@ //unset ($parts); //$this->parse_output($output, $parts, 0); - // print( "<pre>" ); - // print_r( $output ); - // print( "</pre>" ); + //print( "<pre>" );print_r( $output );print_r( "</pre>" ); if (isset($output["text"][0])) { $body = $output["text"][0]; @@ -382,7 +380,11 @@ $body = $output['parts'][0]["text"][0]; } elseif (isset($output['body'])) { $body = $output['body']; - } else { + } elseif (isset($output['parts'][0]['html'][0])) {// some html message does not have a text part + $body = strip_tags(preg_replace('/\n\r/', '', $output['parts'][0]['html'][0])); + } elseif (isset($output['parts'][0]['parts'][0]['text'][0])) { + $body = $output['parts'][0]['parts'][0]['text'][0]; + } else { $body = ""; } @@ -492,7 +494,7 @@ } - $pop3->deleteMsg( 1 ); + $pop3->deleteMsg( 1 ); $pop3->disconnect(); |