Skip to content

Commit

Permalink
fix: add from url regex to allow passing localhost and similar
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Dec 9, 2022
1 parent 6d64ba3 commit cf5c592
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/src/sources/site-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cf5c592

Please sign in to comment.