From 78ff05e9905f80b63307d9f4edb135bda715e9e6 Mon Sep 17 00:00:00 2001 From: Dominik Jansen Date: Wed, 18 Nov 2020 10:52:06 +0100 Subject: [PATCH] fix(facebook): oembed for photos on pages does not work With this commit urls of scheme https://www.facebook.com/{page-name}/photos/{post-id}/{photo-id} will use the oembed_post endpoint resolves: oscarotero/Embed#405 --- src/Adapters/Facebook/OEmbed.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Adapters/Facebook/OEmbed.php b/src/Adapters/Facebook/OEmbed.php index bbeac4aa..b3bcf991 100644 --- a/src/Adapters/Facebook/OEmbed.php +++ b/src/Adapters/Facebook/OEmbed.php @@ -53,9 +53,12 @@ private function getEndpointByPath(string $path): string https://www.facebook.com/media/set?set={set-id} https://www.facebook.com/questions/{question-id} https://www.facebook.com/notes/{username}/{note-url}/{note-id} + + Not in the facebook docs: + https://www.facebook.com/{page-name}/photos/{post-id}/{photo-id} */ if (strpos($path, '/photo.php') === 0 - || strpos($path, '/photos/') === 0 + || strpos($path, '/photos/') !== false || strpos($path, '/permalink.php') === 0 || strpos($path, '/media/') === 0 || strpos($path, '/questions/') === 0