From 1afe017eeeabe7a75179e396e23d75cac864360a Mon Sep 17 00:00:00 2001 From: Alex King Date: Mon, 12 Jan 2004 23:24:51 +0000 Subject: [PATCH] fixed hilite whitespace checking git-svn-id: https://develop.svn.wordpress.org/trunk@770 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index b0411c1656..c795cc4413 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1751,13 +1751,15 @@ function hilite($text) { $search_engines = array('wordpress', 'google', 'lycos', 'yahoo'); foreach ($search_engines as $engine) { - if ( is_referer_search_engine($engine) && !empty($term) && $term != ' ') { + if ( is_referer_search_engine($engine)) { $query_terms = get_search_query_terms($engine); foreach ($query_terms as $term) { - if (!preg_match('/<.+>/',$text)) { - $text = preg_replace('/(\b'.$term.'\b)/i','$1',$text); - } else { - $text = preg_replace('/(?<=>)([^<]+)?(\b'.$term.'\b)/i','$1$2',$text); + if (!empty($term) && $term != ' ') { + if (!preg_match('/<.+>/',$text)) { + $text = preg_replace('/(\b'.$term.'\b)/i','$1',$text); + } else { + $text = preg_replace('/(?<=>)([^<]+)?(\b'.$term.'\b)/i','$1$2',$text); + } } } break;