aboutsummaryrefslogtreecommitdiff
path: root/lib/urlfilter/domain.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-10-19 01:44:06 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-10-19 01:44:06 +0200
commit77b3cd57f930ec70e6f618da70985e23e5cf76fc (patch)
tree712dbb43ec463a8524286d9e6e0fb2d2f8b9d6ab /lib/urlfilter/domain.cpp
parenturlfilter: destroy FilterLeaves only when destroying the FilterTree (diff)
downloadsmolbote-77b3cd57f930ec70e6f618da70985e23e5cf76fc.tar.xz
Integrate FilterTree into browser (#6)
- change filter.path to filter.hosts to represent that the setting is only used for hostlist-format lists - change FilterTree::match to use QUrl and not QString
Diffstat (limited to 'lib/urlfilter/domain.cpp')
-rw-r--r--lib/urlfilter/domain.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/urlfilter/domain.cpp b/lib/urlfilter/domain.cpp
index 20c4f3a..2bfd524 100644
--- a/lib/urlfilter/domain.cpp
+++ b/lib/urlfilter/domain.cpp
@@ -29,6 +29,10 @@ Domain &Domain::operator=(Domain &&other)
bool Domain::matches(const QUrl &url) const
{
+ // empty domain matches all
+ if(m_domain.isEmpty() || url.isEmpty())
+ return true;
+
const QString domain = url.host();
// domain and filter are the same