From cbda060b86aa071b0772d86a61756a0158cb24bd Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Fri, 4 Aug 2017 21:12:43 +0200 Subject: [PATCH] [FacebookBridge] Fix & in URLs All formats except HTML return & instead of & in URLs causing all links with parameters (...&id=...) to break. Facebook does not return valid HTML URIs but instead provides them with all special characters encoded (like using htmlspecialchars). This seems to be related to the page being build almost entirely of script blocks. This commit adds htmlspecialchars_decode() to URI and content to reverse the encoding. References #550 --- bridges/FacebookBridge.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bridges/FacebookBridge.php b/bridges/FacebookBridge.php index cc16196b..4cce5b9d 100644 --- a/bridges/FacebookBridge.php +++ b/bridges/FacebookBridge.php @@ -281,9 +281,11 @@ EOD; if(strlen($title) > 64) $title = substr($title, 0, strpos(wordwrap($title, 64), "\n")) . '...'; + $uri = self::URI . $post->find('abbr')[0]->parent()->getAttribute('href'); + //Build and add final item - $item['uri'] = self::URI . $post->find('abbr')[0]->parent()->getAttribute('href'); - $item['content'] = $content; + $item['uri'] = htmlspecialchars_decode($uri); + $item['content'] = htmlspecialchars_decode($content); $item['title'] = $title; $item['author'] = $author; $item['timestamp'] = $date;