From d2d3804e091011f80e1cc1da9b5ed20769e4b177 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 1 Dec 2014 22:51:41 +0100 Subject: [PATCH] If a link contains BBCode stuff, make a short link out of this to avoid parsing problems --- include/items.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/items.php b/include/items.php index 5b2755935..0398f5458 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]";