From d2d3804e091011f80e1cc1da9b5ed20769e4b177 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 1 Dec 2014 22:51:41 +0100 Subject: [PATCH 1/2] 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 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]"; From 9124d922e9e5bf2b9dbc7ea187237f2a6776bc28 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 1 Dec 2014 22:54:01 +0100 Subject: [PATCH 2/2] In "parse_url" now links with [ or ] are replaced with shortened versions to avoid parsing problems. --- mod/parse_url.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mod/parse_url.php b/mod/parse_url.php index 564b22c042..06e59b8691 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -187,6 +187,9 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co case "description": $siteinfo["text"] = $attr["content"]; break; + case "thumbnail": + $siteinfo["image"] = $attr["content"]; + break; case "twitter:image": $siteinfo["image"] = $attr["content"]; break; @@ -421,6 +424,12 @@ function parse_url_content(&$a) { $url= $siteinfo["url"]; + // If the link contains BBCode stuff, make a short link out of this to avoid parsing problems + if (strpos($url, '[') OR strpos($url, ']')) { + require_once("include/network.php"); + $url = short_link($url); + } + $sitedata = ""; if($siteinfo["title"] == "") {