mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-30 10:08:54 -04:00
Fix loose URL comparison
This commit is contained in:
parent
eac95df000
commit
3c7c3b0a5f
2 changed files with 3 additions and 2 deletions
|
@ -171,8 +171,8 @@ bool UrlTools::isUrlValid(const QString& urlField, bool looseComparison) const
|
|||
url.remove(0, 1);
|
||||
url.remove(url.length() - 1, 1);
|
||||
} else {
|
||||
// Do not allow URL with just wildcards, or double wildcards, or no separator (.)
|
||||
if (url.length() == url.count("*") || url.contains("**") || url.contains("*.*") || !url.contains(".")) {
|
||||
// Do not allow URL with just wildcards, or double wildcards
|
||||
if (url.length() == url.count("*") || url.contains("**") || url.contains("*.*")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -160,6 +160,7 @@ void TestUrlTools::testIsUrlValidWithLooseComparison()
|
|||
urls["https://example.*"] = false;
|
||||
urls["https://*.example.*"] = false;
|
||||
urls["https://example.c*"] = false;
|
||||
urls["https://myowndomain:8000"] = true;
|
||||
|
||||
QHashIterator<QString, bool> i(urls);
|
||||
while (i.hasNext()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue