Remove Twitter exception for shared blocks in Text\BBCode::convertShareCallback

- Twitter stopped supporting OEmbed which defaulted to an undesirable fallback
This commit is contained in:
Hypolite Petovan 2020-06-04 11:13:31 -04:00
parent f68652d61c
commit e0152bec7d

View file

@ -1071,14 +1071,6 @@ class BBCode
$text = '<div><a href="' . $attributes['link'] . '">' . html_entity_decode('&#x2672;', ENT_QUOTES, 'UTF-8') . '</a> ' . $author . '<blockquote>' . $content . '</blockquote></div>' . "\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? '<br />' : '') . OEmbed::getHTML($attributes['link']);
} catch (Exception $e) {
$text = ($is_quote_share? '<br />' : '') . sprintf('[bookmark=%s]%s[/bookmark]', $attributes['link'], $content);
}
} else {
$text = ($is_quote_share? "\n" : '');
$tpl = Renderer::getMarkupTemplate('shared_content.tpl');
@ -1090,7 +1082,6 @@ class BBCode
'$posted' => $attributes['posted'],
'$content' => trim($content)
]);
}
break;
}