diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2017-04-18 23:41:55 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-04-18 18:13:52 -0700 |
commit | 5e67a932cf151dece1afbe70995c0edd31661ac0 (patch) | |
tree | d71adce0b4aee0a86c05bb68d93befd680fa040b /desktop-widgets | |
parent | c257144bab23e90a82db6c138514199a3b7f3ed3 (diff) | |
download | subsurface-5e67a932cf151dece1afbe70995c0edd31661ac0.tar.gz |
More strict filter for URL handling in dive notes
Applie a more strict filter to URL handling in dive notes:
The URL needs to have:
- Scheme like "http:" or "mailto:"
- Host name like "www.test.de" or path like "/pathtosomewhere/"
Otherwise strings like "OTU:" or "Runtime:" are treated as URL.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/simplewidgets.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp index 5680ad867..ceddf691c 100644 --- a/desktop-widgets/simplewidgets.cpp +++ b/desktop-widgets/simplewidgets.cpp @@ -704,7 +704,7 @@ void TextHyperlinkEventFilter::handleUrlTooltip(const QString &urlStr, const QPo bool TextHyperlinkEventFilter::stringMeetsOurUrlRequirements(const QString &maybeUrlStr) { QUrl url(maybeUrlStr, QUrl::StrictMode); - return url.isValid() && (!url.scheme().isEmpty()); + return url.isValid() && (!url.scheme().isEmpty()) && ((!url.authority().isEmpty()) || (!url.path().isEmpty())); } QString TextHyperlinkEventFilter::tryToFormulateUrl(QTextCursor *cursor) |