From c6e9f001e3ea65966c612554674cc9b72f5f92e6 Mon Sep 17 00:00:00 2001 From: lavigor Date: Thu, 21 Jun 2018 03:20:46 +0300 Subject: [PATCH] [ticket/13713] Escape special characters in preg_replace PHPBB3-13713 --- phpBB/phpbb/mention/source/base_group.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/mention/source/base_group.php b/phpBB/phpbb/mention/source/base_group.php index 47784835d7..592c6e0da2 100644 --- a/phpBB/phpbb/mention/source/base_group.php +++ b/phpBB/phpbb/mention/source/base_group.php @@ -124,7 +124,7 @@ abstract class base_group implements source_interface // Grab group data $groups = $this->get_groups(); - $matches = preg_grep('/^' . $keyword . '.*/i', $groups['names']); + $matches = preg_grep('/^' . preg_quote($keyword) . '.*/i', $groups['names']); $group_ids = array_intersect($group_ids, array_flip($matches)); $names = [];