diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/adblock/adblockhostmatcher.cpp | 12 | ||||
-rw-r--r-- | src/bookmarks/bookmarkprovider.cpp | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/adblock/adblockhostmatcher.cpp b/src/adblock/adblockhostmatcher.cpp index b11dab2c..75387974 100644 --- a/src/adblock/adblockhostmatcher.cpp +++ b/src/adblock/adblockhostmatcher.cpp @@ -32,18 +32,18 @@ bool AdBlockHostMatcher::tryAddFilter(const QString &filter) { if (filter.startsWith(QL1S("||"))) { + QString domain = filter.mid(2); - const int indexOfFirstSeparator = domain.indexOf(QL1C('^')); - if (indexOfFirstSeparator < 0) + if (!domain.endsWith(QL1C('^'))) return false; - const int indexOfLastDollar = domain.lastIndexOf(QL1C('$')); - if (indexOfLastDollar >= 0 && indexOfLastDollar != indexOfFirstSeparator + 1) + if (domain.contains(QL1C('$'))) return false; - domain = domain.left(indexOfFirstSeparator); - if (domain.contains(QL1C('/')) || domain.contains(QL1C('*'))) + domain = domain.left(domain.size() - 1); + + if (domain.contains(QL1C('/')) || domain.contains(QL1C('*')) || domain.contains(QL1C('^'))) return false; domain = domain.toLower(); diff --git a/src/bookmarks/bookmarkprovider.cpp b/src/bookmarks/bookmarkprovider.cpp index 8089fb6d..7cd48825 100644 --- a/src/bookmarks/bookmarkprovider.cpp +++ b/src/bookmarks/bookmarkprovider.cpp @@ -78,6 +78,7 @@ BookmarkProvider::BookmarkProvider(QObject *parent) } m_manager = KBookmarkManager::managerForFile(bookfile.path(), "rekonq"); + m_manager->setEditorOptions("", true); connect(m_manager, SIGNAL(changed(const QString &, const QString &)), this, SLOT(slotBookmarksChanged())); |