mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
c257144bab
commit
5e67a932cf
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue