Don't display preview images for links, when the post is marked as sensitive

This commit is contained in:
Michael 2024-02-12 06:01:07 +00:00
parent 2cc8fcc4aa
commit e2cbe0983a

View File

@ -3823,6 +3823,12 @@ class Item
} elseif (preg_match("/.*(\[attachment.*?\].*?\[\/attachment\]).*/ism", $body, $match)) { } elseif (preg_match("/.*(\[attachment.*?\].*?\[\/attachment\]).*/ism", $body, $match)) {
$data = BBCode::getAttachmentData($match[1]); $data = BBCode::getAttachmentData($match[1]);
} }
if ($sensitive) {
$data['image'] = '';
$data['preview'] = '';
}
DI::profiler()->stopRecording(); DI::profiler()->stopRecording();
if (isset($data['url']) && !in_array(strtolower($data['url']), $ignore_links)) { if (isset($data['url']) && !in_array(strtolower($data['url']), $ignore_links)) {