Merge pull request #13892 from annando/no-preview-on-sensitive

Don't display preview images for links, when the post is marked as sensitive
This commit is contained in:
Hypolite Petovan 2024-02-12 22:30:31 -05:00 committed by GitHub
commit 686d0b6dbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)) {