ignore case when highlighting

darcs-hash:20080709215011-84dde-29c80d3210e337614980b647c58b5720b7bfc35f.gz
This commit is contained in:
Evan Prodromou 2008-07-09 17:50:11 -04:00
父節點 2d3ba299b8
當前提交 0ec918604a

查看文件

@ -132,7 +132,7 @@ class PeoplesearchAction extends Action {
} }
function highlight($text, $terms) { function highlight($text, $terms) {
$pattern = '/('.implode('|',array_map('htmlspecialchars', $terms)).')/'; $pattern = '/('.implode('|',array_map('htmlspecialchars', $terms)).')/i';
$result = preg_replace($pattern, '<strong>\\1</strong>', $text); $result = preg_replace($pattern, '<strong>\\1</strong>', $text);
return $result; return $result;
} }