X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FEmail.php;h=0963feb0d214db7e48c461bcf997ba629a26793e;hb=c5040f4daa8594091f4a68ad38d4f889d591058b;hp=b1eeb94d62f8903023c97ae3bec2074b9e828300;hpb=af0e10ee20174a3d127bd1e3fc7951dfabe0b0c1;p=friendica.git diff --git a/src/Protocol/Email.php b/src/Protocol/Email.php index b1eeb94d62..0963feb0d2 100644 --- a/src/Protocol/Email.php +++ b/src/Protocol/Email.php @@ -4,7 +4,7 @@ */ namespace Friendica\Protocol; -require_once 'include/html2plain.php'; +use Friendica\Content\Text\HTML; /** * @brief Email class @@ -25,6 +25,16 @@ class Email $mbox = @imap_open($mailbox, $username, $password); + $errors = imap_errors(); + if (!empty($errors)) { + logger('IMAP Errors occured: ' . json_encode($errors)); + } + + $alerts = imap_alerts(); + if (!empty($alerts)) { + logger('IMAP Alerts occured: ' . json_encode($alerts)); + } + return $mbox; } @@ -111,7 +121,7 @@ class Email if (trim($ret['body']) == '') { $ret['body'] = self::messageGetPart($mbox, $uid, $struc, 0, 'plain'); } else { - $ret['body'] = html2bbcode($ret['body']); + $ret['body'] = HTML::toBBCode($ret['body']); } } else { $text = ''; @@ -128,7 +138,7 @@ class Email } } if (trim($html) != '') { - $ret['body'] = html2bbcode($html); + $ret['body'] = HTML::toBBCode($html); } else { $ret['body'] = $text; } @@ -328,7 +338,7 @@ class Email $body .= "Content-Transfer-Encoding: 8bit\n"; $body .= "Content-Type: text/plain; charset=utf-8; format=flowed\n\n"; - $body .= html2plain($html)."\n"; + $body .= HTML::toPlaintext($html)."\n"; $body .= "--=_".$part."\n"; $body .= "Content-Transfer-Encoding: 8bit\n";