1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-10-07 21:06:29 +02:00

[FacebookBridge] Fix permalink issue (#1358)

Facebook has changed their strategy regarding permalinks, which
now include lots of unnecessary target data. Fortunately it also
contains the unique story id which we can utilize as URI.
This commit is contained in:
LogMANOriginal
2019-12-01 13:24:11 +01:00
committed by GitHub
parent 375831f516
commit df9f7eb778

View File

@@ -701,8 +701,15 @@ EOD;
$uri = $post->find('abbr')[0]->parent()->getAttribute('href');
if (false !== strpos($uri, '?')) {
$uri = substr($uri, 0, strpos($uri, '?'));
// Extract fbid and patch link
if (strpos($uri, '?') !== false) {
$query = substr($uri, strpos($uri, '?') + 1);
parse_str($query, $query_params);
if (isset($query_params['story_fbid'])) {
$uri = self::URI . $query_params['story_fbid'];
} else {
$uri = substr($uri, 0, strpos($uri, '?'));
}
}
//Build and add final item