]> git.mxchange.org Git - friendica.git/blobdiff - include/bbcode.php
Frio: Location should look now similar everywhere
[friendica.git] / include / bbcode.php
index 70cd22d5f9c0eaa960c3aad0ac18a8f8e8f7a8e6..bc307677702bc6ce40c1cd45734f4d1ff92ae2ea 100644 (file)
@@ -101,8 +101,14 @@ function bb_remove_share_information($Text, $plaintext = false, $nolink = false)
        if ($nolink)
                return $data["text"].$data["after"];
 
-       if ($plaintext)
+       $title = htmlentities($data["title"], ENT_QUOTES, 'UTF-8', false);
+       $text = htmlentities($data["text"], ENT_QUOTES, 'UTF-8', false);
+       if ($plaintext OR (($title != "") AND strstr($text, $title)))
                $data["title"] = $data["url"];
+       elseif (($text != "") AND strstr($title, $text)) {
+               $data["text"] = $data["title"];
+               $data["title"] = $data["url"];
+       }
 
        if (($data["text"] == "") AND ($data["title"] != "") AND ($data["url"] == ""))
                return $data["title"].$data["after"];
@@ -115,10 +121,10 @@ function bb_remove_share_information($Text, $plaintext = false, $nolink = false)
 
        if (($data["url"] != "") AND ($data["title"] != ""))
                $text .= "\n[url=".$data["url"]."]".$data["title"]."[/url]";
-       elseif (($link != ""))
+       elseif (($data["url"] != ""))
                $text .= "\n".$data["url"];
 
-       return $text.$data["after"];
+       return $text."\n".$data["after"];
 }
 
 function bb_cleanstyle($st) {