git-svn-id: https://develop.svn.wordpress.org/trunk@1462 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2004-07-13 18:14:54 +00:00
parent dc70d3501d
commit 918aabfbd5
1 changed files with 1 additions and 0 deletions

View File

@ -104,6 +104,7 @@ function hilite($text) {
$query_terms = get_search_query_terms($engine);
foreach ($query_terms as $term) {
if (!empty($term) && $term != ' ') {
$term = preg_quote($term, '/');
if (!preg_match('/<.+>/',$text)) {
$text = preg_replace('/(\b'.$term.'\b)/i','<span class="hilite">$1</span>',$text);
} else {