]> git.mxchange.org Git - friendica.git/commitdiff
Code cleaned
authorMichael <heluecht@pirati.ca>
Mon, 22 Jan 2018 22:26:47 +0000 (22:26 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 22 Jan 2018 22:26:47 +0000 (22:26 +0000)
include/bbcode.php

index cad7ddc9251df74ca149e7713efcf341c5d541f2..3a187c281547f3a1deb9fbcf6e886b575ca3a613 100644 (file)
@@ -970,7 +970,8 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
        // if the HTML is used to generate plain text, then don't do this search, but replace all URL of that kind to text
        if (!$forplaintext) {
                // Autolink feature (thanks to http://code.seebz.net/p/autolink-php/)
-               $autolink_regex = "`([^\]\=\"']|^)(https?\://[^\s<]+[^\s<\.\)])`ism";
+               // Currently disabled, since the function is too greedy
+               // $autolink_regex = "`([^\]\=\"']|^)(https?\://[^\s<]+[^\s<\.\)])`ism";
                $autolink_regex = "/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism";
                $Text = preg_replace($autolink_regex, '$1[url]$2[/url]', $Text);
                if ($simplehtml == 7) {
@@ -1044,10 +1045,6 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
        $expression = "=diaspora://.*?/post/([0-9A-Za-z\-_@.:]{15,254}[0-9A-Za-z])=ism";
        $Text = preg_replace($expression, System::baseUrl()."/display/$1", $Text);
 
-       if ($tryoembed) {
-       //      $Text = preg_replace_callback("/\[url\]([$URLSearchString]*)\[\/url\]/ism", $tryoembed_callback, $Text);
-       }
-
        $Text = preg_replace("/([#])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
                                '$1<a href="$2" class="tag" title="$3">$3</a>', $Text);