]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Text/BBCode.php
Introducing Profiler
[friendica.git] / src / Content / Text / BBCode.php
index e0190c0c1d2005a8751c8b3526b114d7ca9ed7c5..75cb32b626950c9e7b4f8ea49973ff466f28d61f 100644 (file)
@@ -1027,7 +1027,7 @@ class BBCode extends BaseObject
                        @curl_exec($ch);
                        $curl_info = @curl_getinfo($ch);
 
-                       $a->saveTimestamp($stamp1, "network");
+                       $a->getProfiler()->saveTimestamp($stamp1, "network");
 
                        if (substr($curl_info["content_type"], 0, 6) == "image/") {
                                $text = "[url=" . $match[1] . "]" . $match[1] . "[/url]";
@@ -1086,7 +1086,7 @@ class BBCode extends BaseObject
                        @curl_exec($ch);
                        $curl_info = @curl_getinfo($ch);
 
-                       $a->saveTimestamp($stamp1, "network");
+                       $a->getProfiler()->saveTimestamp($stamp1, "network");
 
                        // if its a link to a picture then embed this picture
                        if (substr($curl_info["content_type"], 0, 6) == "image/") {
@@ -1293,7 +1293,7 @@ class BBCode extends BaseObject
                                $text);
                } elseif ($simple_html == 7) {
                        $text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
-                               '$1<span class="vcard"><a href="$2" class="url" title="$3"><span class="fn nickname mention">$3</span></a></span>',
+                               '$1<span class="vcard"><a href="$2" class="url u-url mention" title="$3"><span class="fn nickname mention">$3</span></a></span>',
                                $text);
                } elseif (!$simple_html) {
                        $text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
@@ -1743,7 +1743,7 @@ class BBCode extends BaseObject
 
                // Clean up the HTML by loading and saving the HTML with the DOM.
                // Bad structured html can break a whole page.
-               // For performance reasons do it only with ativated item cache or at export.
+               // For performance reasons do it only with activated item cache or at export.
                if (!$try_oembed || (get_itemcachepath() != "")) {
                        $doc = new DOMDocument();
                        $doc->preserveWhiteSpace = false;
@@ -1915,7 +1915,7 @@ class BBCode extends BaseObject
                // unmask the special chars back to HTML
                $text = str_replace(['&\_lt\_;', '&\_gt\_;', '&\_amp\_;'], ['&lt;', '&gt;', '&amp;'], $text);
 
-               $a->saveTimestamp($stamp1, "parser");
+               $a->getProfiler()->saveTimestamp($stamp1, "parser");
 
                // Libertree has a problem with escaped hashtags.
                $text = str_replace(['\#'], ['#'], $text);
@@ -1959,7 +1959,7 @@ class BBCode extends BaseObject
         $string = preg_replace('/#\[url\=([^\[\]]*)\](.*?)\[\/url\]/ism', '#$2', $string);
 
         // ignore anything in a code block
-        $string = preg_replace('/\[code\](.*?)\[\/code\]/sm', '', $string);
+        $string = preg_replace('/\[code.*?\].*?\[\/code\]/sm', '', $string);
 
         // Force line feeds at bbtags
         $string = str_replace(['[', ']'], ["\n[", "]\n"], $string);