From e0152bec7d34a20c3c075ade8cd643c69fde3895 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 4 Jun 2020 11:13:31 -0400 Subject: [PATCH] Remove Twitter exception for shared blocks in Text\BBCode::convertShareCallback - Twitter stopped supporting OEmbed which defaulted to an undesirable fallback --- src/Content/Text/BBCode.php | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 67dbe3b19a..fa2e3db923 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1071,26 +1071,17 @@ class BBCode $text = '
' . html_entity_decode('♲', ENT_QUOTES, 'UTF-8') . ' ' . $author . '
' . $content . '
' . "\n"; break; default: - // Transforms quoted tweets in rich attachments to avoid nested tweets - if (stripos(Strings::normaliseLink($attributes['link']), 'http://twitter.com/') === 0 && OEmbed::isAllowedURL($attributes['link'])) { - try { - $text = ($is_quote_share? '
' : '') . OEmbed::getHTML($attributes['link']); - } catch (Exception $e) { - $text = ($is_quote_share? '
' : '') . sprintf('[bookmark=%s]%s[/bookmark]', $attributes['link'], $content); - } - } else { - $text = ($is_quote_share? "\n" : ''); - - $tpl = Renderer::getMarkupTemplate('shared_content.tpl'); - $text .= Renderer::replaceMacros($tpl, [ - '$profile' => $attributes['profile'], - '$avatar' => $attributes['avatar'], - '$author' => $attributes['author'], - '$link' => $attributes['link'], - '$posted' => $attributes['posted'], - '$content' => trim($content) - ]); - } + $text = ($is_quote_share? "\n" : ''); + + $tpl = Renderer::getMarkupTemplate('shared_content.tpl'); + $text .= Renderer::replaceMacros($tpl, [ + '$profile' => $attributes['profile'], + '$avatar' => $attributes['avatar'], + '$author' => $attributes['author'], + '$link' => $attributes['link'], + '$posted' => $attributes['posted'], + '$content' => trim($content) + ]); break; } -- 2.39.5