if ($_GET['getText'] == 'html') {
$ret['text'] = BBCode::convert($item['body'], false);
} elseif ($_GET['getText'] == 'plain') {
- $ret['text'] = trim(html2plain(BBCode::convert(api_clean_plain_items($item['body']), false, 2, true), 0));
+ $ret['text'] = trim(HTML::toPlaintext(BBCode::convert(api_clean_plain_items($item['body']), false, 2, true), 0));
}
} else {
- $ret['text'] = $item['title'] . "\n" . html2plain(BBCode::convert(api_clean_plain_items($item['body']), false, 2, true), 0);
+ $ret['text'] = $item['title'] . "\n" . HTML::toPlaintext(BBCode::convert(api_clean_plain_items($item['body']), false, 2, true), 0);
}
if (x($_GET, 'getUserObjects') && $_GET['getUserObjects'] == 'false') {
unset($ret['sender']);
// Workaround for ostatus messages where the title is identically to the body
$html = BBCode::convert(api_clean_plain_items($body), false, 2, true);
- $statusbody = trim(html2plain($html, 0));
+ $statusbody = trim(HTML::toPlaintext($html, 0));
// handle data: images
$statusbody = api_format_items_embeded_images($item, $statusbody);
use Friendica\App;
use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\HTML;
use Friendica\Core\ACL;
use Friendica\Core\Config;
use Friendica\Core\L10n;
// Preparing the meta header
require_once 'include/html2plain.php';
- $description = trim(html2plain(BBCode::convert($s[0]["body"], false), 0, true));
- $title = trim(html2plain(BBCode::convert($s[0]["title"], false), 0, true));
+ $description = trim(HTML::toPlaintext(BBCode::convert($s[0]["body"], false), 0, true));
+ $title = trim(HTML::toPlaintext(BBCode::convert($s[0]["title"], false), 0, true));
$author_name = $s[0]["author-name"];
$image = $a->remove_baseurl($s[0]["author-thumb"]);
'replyTo' => $a->user['email'],
'messageSubject' => $subject,
'htmlVersion' => $message,
- 'textVersion' => html2plain($html.$disclaimer)
+ 'textVersion' => Friendica\Content\Text\HTML::toPlaintext($html.$disclaimer)
];
Emailer::send($params);
}
}
$html = self::convert($post["text"].$post["after"], false, $htmlmode);
- $msg = html2plain($html, 0, true);
+ $msg = HTML::toPlaintext($html, 0, true);
$msg = trim(html_entity_decode($msg, ENT_QUOTES, 'UTF-8'));
$link = "";
$n['timestamp'] = strtotime($local_time);
$n['date_rel'] = Temporal::getRelativeDate($n['date']);
$n['msg_html'] = BBCode::convert($n['msg'], false);
- $n['msg_plain'] = explode("\n", trim(html2plain($n['msg_html'], 0)))[0];
+ $n['msg_plain'] = explode("\n", trim(Friendica\Content\Text\HTML::toPlaintext($n['msg_html'], 0)))[0];
$rets[] = $n;
}
$body .= "Content-Transfer-Encoding: 8bit\n";
$body .= "Content-Type: text/plain; charset=utf-8; format=flowed\n\n";
- $body .= html2plain($html)."\n";
+ $body .= Friendica\Content\Text\HTML::toPlaintext($html)."\n";
$body .= "--=_".$part."\n";
$body .= "Content-Transfer-Encoding: 8bit\n";