aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-04-28 09:32:58 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-04-28 09:32:58 +0200
commitb10b8e2c50374c3f2f7d8f02b77f726c8921b721 (patch)
tree6c0c66ec8057a8c1433cc4ab8a5ebb1b2da149fb /src/main/java/eu/siacs/conversations/services
parentf8e06d8e9a45d5e08c067fe9302ea96ddeebd175 (diff)
escape nick in highlight regex pattern
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services')
-rw-r--r--src/main/java/eu/siacs/conversations/services/NotificationService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java
index 7269a559..be01eebd 100644
--- a/src/main/java/eu/siacs/conversations/services/NotificationService.java
+++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java
@@ -454,7 +454,7 @@ public class NotificationService {
// nick (matched in case-insensitive manner), followed by optional
// punctuation (for example "bob: i disagree" or "how are you alice?"),
// followed by another word boundary.
- return Pattern.compile("\\b" + nick + "\\p{Punct}?\\b",
+ return Pattern.compile("\\b" + Pattern.quote(nick) + "\\p{Punct}?\\b",
Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
}