diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-04-28 09:32:58 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-04-28 09:32:58 +0200 |
commit | b10b8e2c50374c3f2f7d8f02b77f726c8921b721 (patch) | |
tree | 6c0c66ec8057a8c1433cc4ab8a5ebb1b2da149fb /src/main/java/eu | |
parent | f8e06d8e9a45d5e08c067fe9302ea96ddeebd175 (diff) |
escape nick in highlight regex pattern
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/NotificationService.java | 2 |
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 7269a559b..be01eebdf 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); } |