From cf5c592fafc679a9f8b5b104a9d7fc1002bc90b5 Mon Sep 17 00:00:00 2001 From: Bionus Date: Fri, 9 Dec 2022 23:03:16 +0100 Subject: [PATCH] fix: add from url regex to allow passing localhost and similar --- src/gui/src/sources/site-window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/src/sources/site-window.cpp b/src/gui/src/sources/site-window.cpp index 80802bb73..4a775b9ba 100644 --- a/src/gui/src/sources/site-window.cpp +++ b/src/gui/src/sources/site-window.cpp @@ -46,7 +46,7 @@ void SiteWindow::accept() } // Check URL validity - if (!QRegularExpression(R"(^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([\/\w .-?]*)*\/?$)").match(m_url).hasMatch()) { + if (!QRegularExpression(R"(^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$)").match(m_url).hasMatch()) { error(this, tr("The url you entered is not valid.")); return; }