Make WordPress Core


Ignore:
Timestamp:
11/15/2008 05:56:44 PM (17 years ago)
Author:
ryan
Message:

Notice fixes. Props DD32. see #7509

File:
1 edited

Legend:

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

    r9596 r9714  
    17411741            // added slashes screw with quote grouping when done early, so done later
    17421742            $q['s'] = stripslashes($q['s']);
    1743             if ($q['sentence']) {
     1743            if ( !empty($q['sentence']) ) {
    17441744                $q['search_terms'] = array($q['s']);
    17451745            } else {
    1746                 preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q[s], $matches);
     1746                preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q['s'], $matches);
    17471747                $q['search_terms'] = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
    17481748            }
    1749             $n = ($q['exact']) ? '' : '%';
     1749            $n = !empty($q['exact']) ? '' : '%';
    17501750            $searchand = '';
    17511751            foreach( (array) $q['search_terms'] as $term) {
     
    17551755            }
    17561756            $term = $wpdb->escape($q['s']);
    1757             if (!$q['sentence'] && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
     1757            if (empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
    17581758                $search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
    17591759
Note: See TracChangeset for help on using the changeset viewer.