mirror of https://github.com/procxx/kepka.git
Add more warnings for suspicious urls.
This commit is contained in:
parent
ef30c776bf
commit
ca97e3c375
|
@ -1433,6 +1433,11 @@ Link::Link(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto createHandler = [](const QString &url) {
|
||||||
|
return UrlClickHandler::IsSuspicious(url)
|
||||||
|
? std::make_shared<HiddenUrlClickHandler>(url)
|
||||||
|
: std::make_shared<UrlClickHandler>(url);
|
||||||
|
};
|
||||||
_page = media ? media->webpage() : nullptr;
|
_page = media ? media->webpage() : nullptr;
|
||||||
if (_page) {
|
if (_page) {
|
||||||
mainUrl = _page->url;
|
mainUrl = _page->url;
|
||||||
|
@ -1442,7 +1447,7 @@ Link::Link(
|
||||||
parent->fullId());
|
parent->fullId());
|
||||||
} else if (_page->photo) {
|
} else if (_page->photo) {
|
||||||
if (_page->type == WebPageType::Profile || _page->type == WebPageType::Video) {
|
if (_page->type == WebPageType::Profile || _page->type == WebPageType::Video) {
|
||||||
_photol = std::make_shared<UrlClickHandler>(_page->url);
|
_photol = createHandler(_page->url);
|
||||||
} else if (_page->type == WebPageType::Photo
|
} else if (_page->type == WebPageType::Photo
|
||||||
|| _page->siteName == qstr("Twitter")
|
|| _page->siteName == qstr("Twitter")
|
||||||
|| _page->siteName == qstr("Facebook")) {
|
|| _page->siteName == qstr("Facebook")) {
|
||||||
|
@ -1450,13 +1455,13 @@ Link::Link(
|
||||||
_page->photo,
|
_page->photo,
|
||||||
parent->fullId());
|
parent->fullId());
|
||||||
} else {
|
} else {
|
||||||
_photol = std::make_shared<UrlClickHandler>(_page->url);
|
_photol = createHandler(_page->url);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_photol = std::make_shared<UrlClickHandler>(_page->url);
|
_photol = createHandler(_page->url);
|
||||||
}
|
}
|
||||||
} else if (!mainUrl.isEmpty()) {
|
} else if (!mainUrl.isEmpty()) {
|
||||||
_photol = std::make_shared<UrlClickHandler>(mainUrl);
|
_photol = createHandler(mainUrl);
|
||||||
}
|
}
|
||||||
if (from >= till && _page) {
|
if (from >= till && _page) {
|
||||||
text = _page->description.text;
|
text = _page->description.text;
|
||||||
|
|
Loading…
Reference in New Issue