소스 검색

[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 6 년 전
부모
커밋
cbda060b86
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  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;