mirror of
https://github.com/friendica/friendica
synced 2025-01-03 20:02:19 +00:00
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:
parent
f68652d61c
commit
e0152bec7d
1 changed files with 10 additions and 19 deletions
|
@ -1071,26 +1071,17 @@ class BBCode
|
||||||
$text = '<div><a href="' . $attributes['link'] . '">' . html_entity_decode('♲', ENT_QUOTES, 'UTF-8') . '</a> ' . $author . '<blockquote>' . $content . '</blockquote></div>' . "\n";
|
$text = '<div><a href="' . $attributes['link'] . '">' . html_entity_decode('♲', ENT_QUOTES, 'UTF-8') . '</a> ' . $author . '<blockquote>' . $content . '</blockquote></div>' . "\n";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// Transforms quoted tweets in rich attachments to avoid nested tweets
|
$text = ($is_quote_share? "\n" : '');
|
||||||
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');
|
$tpl = Renderer::getMarkupTemplate('shared_content.tpl');
|
||||||
$text .= Renderer::replaceMacros($tpl, [
|
$text .= Renderer::replaceMacros($tpl, [
|
||||||
'$profile' => $attributes['profile'],
|
'$profile' => $attributes['profile'],
|
||||||
'$avatar' => $attributes['avatar'],
|
'$avatar' => $attributes['avatar'],
|
||||||
'$author' => $attributes['author'],
|
'$author' => $attributes['author'],
|
||||||
'$link' => $attributes['link'],
|
'$link' => $attributes['link'],
|
||||||
'$posted' => $attributes['posted'],
|
'$posted' => $attributes['posted'],
|
||||||
'$content' => trim($content)
|
'$content' => trim($content)
|
||||||
]);
|
]);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue