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

darcs-hash:20080718183534-84dde-a8cdb4cbcb3eb67152eb74179e3b00061e2287cf.gz
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