oembed: implement a max oembed size which defaults to 1MB and do not try to oembed text previews

This commit is contained in:
Mario
2022-06-03 08:51:54 +00:00
parent d1a8e7813a
commit 5e112b395d
4 changed files with 22 additions and 3 deletions

View File

@@ -860,7 +860,7 @@ class Enotify {
// convert this logic into a json array just like the system notifications
$who = (($item['verb'] === ACTIVITY_SHARE) ? 'owner' : 'author');
$body = html2plain(bbcode($item['body'], ['drop_media']), 75, true);
$body = html2plain(bbcode($item['body'], ['drop_media' => true, 'tryoembed' => false]), 75, true);
if ($body) {
$body = htmlentities($body, ENT_QUOTES, 'UTF-8', false);
}

View File

@@ -113,7 +113,7 @@ class Messages {
}
if (!$summary) {
$summary = html2plain(bbcode($item['body'], ['drop_media' => true]), 75, true);
$summary = html2plain(bbcode($item['body'], ['drop_media' => true, 'tryoembed' => false]), 75, true);
if ($summary) {
$summary = htmlentities($summary, ENT_QUOTES, 'UTF-8', false);
}

View File

@@ -31,7 +31,7 @@ class Notes {
$o = replace_macros($tpl, array(
'$text' => $text,
'$html' => bbcode($text),
'$html' => bbcode($text, ['tryoembed' => false]),
'$app' => ((isset($arr['app'])) ? true : false),
'$hidden' => ((isset($arr['hidden'])) ? true : false),
'$strings' => [