]> git.mxchange.org Git - friendica.git/commitdiff
Shared links to Diaspora should look better now
authorMichael Vogel <icarus@dabo.de>
Tue, 3 May 2016 18:12:13 +0000 (20:12 +0200)
committerMichael Vogel <icarus@dabo.de>
Tue, 3 May 2016 18:12:13 +0000 (20:12 +0200)
include/bbcode.php

index 70cd22d5f9c0eaa960c3aad0ac18a8f8e8f7a8e6..62ee4da90cd6d23394b2e15b6cf70929635322e1 100644 (file)
@@ -101,7 +101,10 @@ 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 strstr($text, $title))
                $data["title"] = $data["url"];
 
        if (($data["text"] == "") AND ($data["title"] != "") AND ($data["url"] == ""))
@@ -115,10 +118,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) {