Update "mrpetovan" email address
[friendica.git/.git] / src / Content / Text / Markdown.php
index e7383a3..c50319e 100644 (file)
@@ -9,13 +9,12 @@ 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
  *
- * @author Hypolite Petovan <mrpetovan@gmail.com>
+ * @author Hypolite Petovan <hypolite@mrpetovan.com>
  */
 class Markdown extends BaseObject
 {
@@ -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('&#35;', '#', $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('&#x2672;', html_entity_decode('&#x2672;', ENT_QUOTES, 'UTF-8'), $s);