Explorar o código

[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
logmanoriginal %!s(int64=6) %!d(string=hai) anos
pai
achega
cbda060b86
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      bridges/FacebookBridge.php

+ 4 - 2
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;