git-svn-id: http://svn.automattic.com/wordpress/trunk@1462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-07-13 18:14:54 +00:00
parent a166bd1267
commit 91b74efae1
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 {