From: Michael Vogel Date: Mon, 1 Dec 2014 21:51:41 +0000 (+0100) Subject: If a link contains BBCode stuff, make a short link out of this to avoid parsing problems X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d2d3804e091011f80e1cc1da9b5ed20769e4b177;p=friendica.git If a link contains BBCode stuff, make a short link out of this to avoid parsing problems --- diff --git a/include/items.php b/include/items.php index 5b27559357..0398f54588 100644 --- a/include/items.php +++ b/include/items.php @@ -903,6 +903,12 @@ function add_page_info_data($data) { if ($no_photos AND ($data["type"] == "photo")) return(""); + // If the link contains BBCode stuff, make a short link out of this to avoid parsing problems + if (strpos($data["url"], '[') OR strpos($data["url"], ']')) { + require_once("include/network.php"); + $data["url"] = short_link($data["url"]); + } + if (($data["type"] != "photo") AND is_string($data["title"])) $text .= "[bookmark=".$data["url"]."]".trim($data["title"])."[/bookmark]";