fix missing escape for usernick used in regexp
authorsheepluva
Mon, 13 Jan 2014 19:34:39 +0100
changeset 9979 710e0f92c2ab
parent 9977 e2ecde00b2a7
child 9981 94f5e5cd151b
fix missing escape for usernick used in regexp
QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/ui/widget/chatwidget.cpp	Sun Jan 12 16:21:57 2014 +0400
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Mon Jan 13 19:34:39 2014 +0100
@@ -544,7 +544,8 @@
     QString hlRegExp("^(.* )?%1[^-a-z0-9_]*( .*)?$");
     QRegExp whitespace("\\s");
 
-    m_highlights.append(QRegExp(hlRegExp.arg(m_userNick.toLower())));
+    if (!m_userNick.isEmpty())
+        m_highlights.append(QRegExp(hlRegExp.arg(QRegExp::escape(m_userNick.toLower()))));
 
     QFile file(cfgdir->absolutePath() + "/" + m_userNick.toLower() + "_highlight.txt");