From ab76da1ad217fc814e189de13f145013bca62bce Mon Sep 17 00:00:00 2001 From: "Srivats P." Date: Wed, 6 May 2015 21:47:46 +0530 Subject: [PATCH] Bugfix: Escape the username RegExp used for filtering Ports window --- client/portswindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/portswindow.cpp b/client/portswindow.cpp index baa3ed4..b35b10e 100644 --- a/client/portswindow.cpp +++ b/client/portswindow.cpp @@ -163,9 +163,10 @@ void PortsWindow::showMyReservedPortsOnly(bool enabled) return; if (enabled) { - QString rx = "Port Group|\\[xxx\\]"; - rx.replace("xxx", - appSettings->value(kUserKey, kUserDefaultValue).toString()); + QString rx = "Port Group|\\[" + + QRegExp::escape(appSettings->value(kUserKey, + kUserDefaultValue).toString()) + + "\\]"; qDebug("%s: regexp: <%s>", __FUNCTION__, qPrintable(rx)); proxyPortModel->setFilterRegExp(QRegExp(rx)); }