Selaa lähdekoodia

[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 7 vuotta sitten
vanhempi
commit
cbda060b86
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  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;