mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-18 17:40:59 +00:00
Do not open non-images as image
QImageReader might report PDF as a viable image type, if Qt is dynamically linked and QtWebEngine is installed. Fixed by additionally checking the mime type. Fixes #8102
This commit is contained in:
parent
ae31bdcd1b
commit
f697abe9a1
@ -322,7 +322,7 @@ void DocumentOpenClickHandler::Open(
|
||||
location.accessDisable();
|
||||
});
|
||||
const auto path = location.name();
|
||||
if (QImageReader(path).canRead()) {
|
||||
if (Core::MimeTypeForFile(path).name().startsWith("image/") && QImageReader(path).canRead()) {
|
||||
Core::App().showDocument(data, context);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user