From c438e478275f130be1dd2c5b2fb897a638e7008d Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 8 Mar 2018 19:58:35 +0000 Subject: [PATCH] Bugfix: Avoid "Class not found" error --- src/Content/Text/Markdown.php | 3 ++- src/Core/NotificationsManager.php | 3 ++- src/Protocol/DFRN.php | 3 ++- src/Protocol/Email.php | 2 +- src/Protocol/Feed.php | 4 +++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Content/Text/Markdown.php b/src/Content/Text/Markdown.php index ff6f890bb5..ac598d0fc4 100644 --- a/src/Content/Text/Markdown.php +++ b/src/Content/Text/Markdown.php @@ -9,6 +9,7 @@ namespace Friendica\Content\Text; use Friendica\BaseObject; use Friendica\Model\Contact; use Michelf\MarkdownExtra; +use Friendica\Content\Text\HTML; /** * Friendica-specific usage of Markdown @@ -92,7 +93,7 @@ class Markdown extends BaseObject $s = str_replace('#', '#', $s); - $s = Friendica\Content\Text\HTML::toBBCode($s); + $s = HTML::toBBCode($s); // protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands $s = str_replace('♲', html_entity_decode('♲', ENT_QUOTES, 'UTF-8'), $s); diff --git a/src/Core/NotificationsManager.php b/src/Core/NotificationsManager.php index 95be5cdede..2f2af5174a 100644 --- a/src/Core/NotificationsManager.php +++ b/src/Core/NotificationsManager.php @@ -8,6 +8,7 @@ namespace Friendica\Core; use Friendica\BaseObject; use Friendica\Content\Text\BBCode; +use Friendica\Content\Text\HTML; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; @@ -46,7 +47,7 @@ class NotificationsManager extends BaseObject $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(Friendica\Content\Text\HTML::toPlaintext($n['msg_html'], 0)))[0]; + $n['msg_plain'] = explode("\n", trim(HTML::toPlaintext($n['msg_html'], 0)))[0]; $rets[] = $n; } diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 3def7d3a8c..16764056cb 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -11,6 +11,7 @@ namespace Friendica\Protocol; use Friendica\App; use Friendica\Content\OEmbed; use Friendica\Content\Text\BBCode; +use Friendica\Content\Text\HTML; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -2453,7 +2454,7 @@ class DFRN $purifier = new HTMLPurifier($config); $item['body'] = $purifier->purify($item['body']); - $item['body'] = @Friendica\Content\Text\HTML::toBBCode($item['body']); + $item['body'] = @HTML::toBBCode($item['body']); } /// @todo We should check for a repeated post and if we know the repeated author. diff --git a/src/Protocol/Email.php b/src/Protocol/Email.php index 054a1f4ff7..c3825a16bd 100644 --- a/src/Protocol/Email.php +++ b/src/Protocol/Email.php @@ -328,7 +328,7 @@ class Email $body .= "Content-Transfer-Encoding: 8bit\n"; $body .= "Content-Type: text/plain; charset=utf-8; format=flowed\n\n"; - $body .= Friendica\Content\Text\HTML::toPlaintext($html)."\n"; + $body .= HTML::toPlaintext($html)."\n"; $body .= "--=_".$part."\n"; $body .= "Content-Transfer-Encoding: 8bit\n"; diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index c67df646b4..cf5734facc 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -10,6 +10,8 @@ use Friendica\Database\DBM; use Friendica\Core\System; use Friendica\Model\Item; use Friendica\Util\Network; +use Friendica\Content\Text\HTML; + use dba; use DOMDocument; use DOMXPath; @@ -362,7 +364,7 @@ class Feed { if (self::titleIsBody($item["title"], $body)) { $item["title"] = ""; } - $item["body"] = Friendica\Content\Text\HTML::toBBCode($body, $basepath); + $item["body"] = HTML::toBBCode($body, $basepath); if (($item["body"] == '') && ($item["title"] != '')) { $item["body"] = $item["title"]; -- 2.39.5