mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-04 23:55:08 -04:00
Correct regex escape logic
* Fixes #7776 Implement QRegularExpression::escape within Tools::convertToRegex to allow usage on older Qt versions. Also wrap EXACT_MODIFIER patterns in a non-capture group to prevent misinterpreted regex.
This commit is contained in:
parent
924eb6dbc4
commit
e16c007d43
6 changed files with 136 additions and 18 deletions
|
@ -224,7 +224,7 @@ void TestEntrySearcher::testSearchTermParser()
|
|||
QCOMPARE(terms.length(), 2);
|
||||
|
||||
QCOMPARE(terms[0].field, EntrySearcher::Field::Url);
|
||||
QCOMPARE(terms[0].regex.pattern(), QString("^.*\\.google\\.com$"));
|
||||
QCOMPARE(terms[0].regex.pattern(), QString("^(?:.*\\.google\\.com)$"));
|
||||
|
||||
QCOMPARE(terms[1].field, EntrySearcher::Field::Username);
|
||||
QCOMPARE(terms[1].regex.pattern(), QString("\\d+\\w{2}"));
|
||||
|
@ -237,7 +237,7 @@ void TestEntrySearcher::testSearchTermParser()
|
|||
|
||||
QCOMPARE(terms[0].field, EntrySearcher::Field::AttributeValue);
|
||||
QCOMPARE(terms[0].word, QString("abc"));
|
||||
QCOMPARE(terms[0].regex.pattern(), QString("^efg$"));
|
||||
QCOMPARE(terms[0].regex.pattern(), QString("^(?:efg)$"));
|
||||
|
||||
QCOMPARE(terms[1].field, EntrySearcher::Field::AttributeValue);
|
||||
QCOMPARE(terms[1].word, QString("def"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue