Make WordPress Core

Changeset 770


Ignore:
Timestamp:
01/12/2004 11:24:51 PM (23 years ago)
Author:
alex_t_king
Message:

fixed hilite whitespace checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r755 r770  
    17521752
    17531753        foreach ($search_engines as $engine) {
    1754                 if ( is_referer_search_engine($engine) && !empty($term) && $term != ' ') {
     1754                if ( is_referer_search_engine($engine)) {
    17551755                        $query_terms = get_search_query_terms($engine);
    17561756                        foreach ($query_terms as $term) {
    1757                                 if (!preg_match('/<.+>/',$text)) {
    1758                                         $text = preg_replace('/(\b'.$term.'\b)/i','<span class="hilite">$1</span>',$text);
    1759                                 } else {
    1760                                         $text = preg_replace('/(?<=>)([^<]+)?(\b'.$term.'\b)/i','$1<span class="hilite">$2</span>',$text);
     1757                                if (!empty($term) && $term != ' ') {
     1758                                        if (!preg_match('/<.+>/',$text)) {
     1759                                                $text = preg_replace('/(\b'.$term.'\b)/i','<span class="hilite">$1</span>',$text);
     1760                                        } else {
     1761                                                $text = preg_replace('/(?<=>)([^<]+)?(\b'.$term.'\b)/i','$1<span class="hilite">$2</span>',$text);
     1762                                        }
    17611763                                }
    17621764                        }
Note: See TracChangeset for help on using the changeset viewer.