From e2cbe0983a45a8ecbeed037d75a73bd06207d1da Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 12 Feb 2024 06:01:07 +0000 Subject: [PATCH] Don't display preview images for links, when the post is marked as sensitive --- src/Model/Item.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Model/Item.php b/src/Model/Item.php index aa3a8bc08b..9aa7e1be3f 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -3823,6 +3823,12 @@ class Item } elseif (preg_match("/.*(\[attachment.*?\].*?\[\/attachment\]).*/ism", $body, $match)) { $data = BBCode::getAttachmentData($match[1]); } + + if ($sensitive) { + $data['image'] = ''; + $data['preview'] = ''; + } + DI::profiler()->stopRecording(); if (isset($data['url']) && !in_array(strtolower($data['url']), $ignore_links)) {