From 5e67a932cf151dece1afbe70995c0edd31661ac0 Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Tue, 18 Apr 2017 23:41:55 +0200 Subject: 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 --- desktop-widgets/simplewidgets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets') 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) -- cgit v1.2.3-70-g09d2