diff --git a/src/Model/Item.php b/src/Model/Item.php index 5cf6f5432f..7cda359003 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2726,22 +2726,6 @@ class Item $item['hashtags'] = $tags['hashtags']; $item['mentions'] = $tags['mentions']; - // Compile eventual content filter reasons - $filter_reasons = []; - if (!$is_preview && public_contact() != $item['author-id']) { - if (!empty($item['content-warning']) && (!local_user() || !DI::pConfig()->get(local_user(), 'system', 'disable_cw', false))) { - $filter_reasons[] = DI::l10n()->t('Content warning: %s', $item['content-warning']); - } - - $hook_data = [ - 'item' => $item, - 'filter_reasons' => $filter_reasons - ]; - Hook::callAll('prepare_body_content_filter', $hook_data); - $filter_reasons = $hook_data['filter_reasons']; - unset($hook_data); - } - $body = $item['body'] ?? ''; $shared = BBCode::fetchShareAttributes($body); if (!empty($shared['guid'])) { @@ -2765,6 +2749,22 @@ class Item $item['body'] = $body; $s = $item["rendered-html"]; + // Compile eventual content filter reasons + $filter_reasons = []; + if (!$is_preview && public_contact() != $item['author-id']) { + if (!empty($item['content-warning']) && (!local_user() || !DI::pConfig()->get(local_user(), 'system', 'disable_cw', false))) { + $filter_reasons[] = DI::l10n()->t('Content warning: %s', $item['content-warning']); + } + + $hook_data = [ + 'item' => $item, + 'filter_reasons' => $filter_reasons + ]; + Hook::callAll('prepare_body_content_filter', $hook_data); + $filter_reasons = $hook_data['filter_reasons']; + unset($hook_data); + } + $hook_data = [ 'item' => $item, 'html' => $s,