From b10b8e2c50374c3f2f7d8f02b77f726c8921b721 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 28 Apr 2015 09:32:58 +0200 Subject: escape nick in highlight regex pattern --- src/main/java/eu/siacs/conversations/services/NotificationService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main') 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); } -- cgit v1.2.3