]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Text/Markdown.php
Merge pull request #5563 from MrPetovan/bug/5470-fix-various-notices
[friendica.git] / src / Content / Text / Markdown.php
index e7383a3fd79341c9e3290b34b3ee04f5e98e40e1..71d1a7b849c92dd7aab25bf8e7de105ea42ba1e2 100644 (file)
@@ -9,8 +9,7 @@ namespace Friendica\Content\Text;
 use Friendica\BaseObject;
 use Friendica\Model\Contact;
 use Michelf\MarkdownExtra;
-
-require_once  'include/html2bbcode.php';
+use Friendica\Content\Text\HTML;
 
 /**
  * Friendica-specific usage of Markdown
@@ -54,6 +53,10 @@ class Markdown extends BaseObject
 
                $data = Contact::getDetailsByAddr($match[2]);
 
+               if (empty($data)) {
+                       return;
+               }
+
                $name = $match[1];
 
                if ($name == '') {
@@ -94,7 +97,7 @@ class Markdown extends BaseObject
 
                $s = str_replace('#', '#', $s);
 
-               $s = html2bbcode($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);