Changeset 9714 for trunk/wp-includes/query.php
- Timestamp:
- 11/15/2008 05:56:44 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r9596 r9714 1741 1741 // added slashes screw with quote grouping when done early, so done later 1742 1742 $q['s'] = stripslashes($q['s']); 1743 if ( $q['sentence']) {1743 if ( !empty($q['sentence']) ) { 1744 1744 $q['search_terms'] = array($q['s']); 1745 1745 } else { 1746 preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q[ s], $matches);1746 preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q['s'], $matches); 1747 1747 $q['search_terms'] = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]); 1748 1748 } 1749 $n = ($q['exact']) ? '' : '%';1749 $n = !empty($q['exact']) ? '' : '%'; 1750 1750 $searchand = ''; 1751 1751 foreach( (array) $q['search_terms'] as $term) { … … 1755 1755 } 1756 1756 $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'] ) 1758 1758 $search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')"; 1759 1759
Note: See TracChangeset
for help on using the changeset viewer.