We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 7853df51 authored by Evan Prodromou's avatar Evan Prodromou

quote match terms

parent f50bc704
......@@ -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, '<strong>\\1</strong>', htmlspecialchars($text));
return $result;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment