1
0
Derivar 0

gui: PreviewGeneratorPlaintext: Escape words we pass to QRegularExpression

Este cometimento está contido em:
Albert S. 2022-11-13 17:27:45 +01:00
ascendente d55187a71c
cometimento abce4cfcd9
1 ficheiros modificados com 1 adições e 1 eliminações

Ver ficheiro

@ -103,7 +103,7 @@ QString PreviewGeneratorPlainText::generateLineBasedPreviewText(QTextStream &in,
int foundWordsCount = 0;
for(QString &word : config.wordsToHighlight)
{
QRegularExpression searchRegex("\\b" + word + "\\b");
QRegularExpression searchRegex("\\b" + QRegularExpression::escape(word) + "\\b");
bool containsRegex = line.contains(searchRegex);
bool contains = false;
if(!containsRegex)