Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion EmbedPress/Shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,16 @@ public static function parseContent($subject, $stripNewLine = false, $customAttr
// Get provider name using Helper method
$provider_name = Helper::get_provider_name($url);

$embed = (object) array_merge((array) $urlData, [
$urlDataArr = (array) $urlData;
// Drop upstream provider errors when the fallback produced a
// real embed. FB reel URLs surface a Graph API OAuth error via
// WP core's oEmbed, and the Gutenberg block rejects responses
// that carry an `error` field even when `embed` is valid.
if (isset($urlDataArr['error']) && preg_match('~<(iframe|embed|script|blockquote|video|object)\b~i', $parsedContent)) {
unset($urlDataArr['error']);
}

$embed = (object) array_merge($urlDataArr, [
'attributes' => (object) self::get_oembed_attributes(),
'embed' => $parsedContent,
'url' => $url,
Expand Down
Loading