From 7853df51cec346ac2479cb25d5224b6ad69135c8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 18 Jul 2008 14:35:34 -0400 Subject: [PATCH] quote match terms darcs-hash:20080718183534-84dde-a8cdb4cbcb3eb67152eb74179e3b00061e2287cf.gz --- actions/peoplesearch.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 323065d7a9..f700cf46e7 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -115,7 +115,8 @@ class PeoplesearchAction extends SearchAction { } function highlight($text, $terms) { - $pattern = '/('.implode('|',array_map('htmlspecialchars', $terms)).')/i'; + $terms = array_map('preg_quote', array_map('htmlspecialchars', $terms)); + $pattern = '/('.implode('|',$terms).')/i'; $result = preg_replace($pattern, '\\1', htmlspecialchars($text)); return $result; } -- 2.39.5