Replace html2plain calls by HTML::toPlaintext

This commit is contained in:
Hypolite Petovan 2018-03-07 16:29:44 -05:00
parent b5666bd27f
commit 5e806ff598
6 changed files with 10 additions and 9 deletions

View file

@ -5,6 +5,7 @@
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;
@ -369,8 +370,8 @@ function display_content(App $a, $update = false, $update_uid = 0) {
// 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"]);

View file

@ -816,7 +816,7 @@ function item_post(App $a) {
'replyTo' => $a->user['email'],
'messageSubject' => $subject,
'htmlVersion' => $message,
'textVersion' => html2plain($html.$disclaimer)
'textVersion' => Friendica\Content\Text\HTML::toPlaintext($html.$disclaimer)
];
Emailer::send($params);
}