Index: wp-includes/query.php =================================================================== --- wp-includes/query.php (.../2.1.1) (revision 5900) +++ wp-includes/query.php (.../2.1.2) (revision 5900) @@ -765,9 +765,11 @@ $searchand = ' AND '; } $term = addslashes_gpc($q['s']); - if (!$q['sentence'] && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] ) $search .= " OR (post_title LIKE '{$n}{$term}{$n}') OR (post_content LIKE '{$n}{$term}{$n}')"; - - $search = " AND ({$search}) "; + if (!$q['sentence'] && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] ) + $search .= " OR (post_title LIKE '{$n}{$term}{$n}') OR (post_content LIKE '{$n}{$term}{$n}')"; + + if ( !empty($search) ) + $search = " AND ({$search}) "; } // Category stuff @@ -794,16 +796,16 @@ $in_cats = substr($in_cats, 0, -2); $out_cats = substr($out_cats, 0, -2); if ( strlen($in_cats) > 0 ) - $in_cats = " AND category_id IN ($in_cats)"; + $in_cats = " AND $wpdb->post2cat.category_id IN ($in_cats)"; if ( strlen($out_cats) > 0 ) { - $ids = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE category_id IN ($out_cats)"); + $ids = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE $wpdb->post2cat.category_id IN ($out_cats)"); if ( is_array($ids) && count($ids > 0) ) { foreach ( $ids as $id ) $out_posts .= "$id, "; $out_posts = substr($out_posts, 0, -2); } if ( strlen($out_posts) > 0 ) - $out_cats = " AND ID NOT IN ($out_posts)"; + $out_cats = " AND $wpdb->posts.ID NOT IN ($out_posts)"; else $out_cats = ''; } Index: wp-includes/version.php =================================================================== --- wp-includes/version.php (.../2.1.1) (revision 5900) +++ wp-includes/version.php (.../2.1.2) (revision 5900) @@ -2,7 +2,7 @@ // This holds the version number in a separate file so we can bump it without cluttering the SVN -$wp_version = '2.1.1'; +$wp_version = '2.1.2'; $wp_db_version = 4773; ?> Index: wp-includes/js/tinymce/tiny_mce_config.php =================================================================== --- wp-includes/js/tinymce/tiny_mce_config.php (.../2.1.1) (revision 5900) +++ wp-includes/js/tinymce/tiny_mce_config.php (.../2.1.2) (revision 5900) @@ -1,5 +1,6 @@ ", valid_elements : "", Index: wp-includes/functions.php =================================================================== --- wp-includes/functions.php (.../2.1.1) (revision 5900) +++ wp-includes/functions.php (.../2.1.2) (revision 5900) @@ -1190,7 +1190,7 @@ $adminurl = get_option('siteurl') . '/wp-admin'; if ( wp_get_referer() ) - $adminurl = wp_get_referer(); + $adminurl = attribute_escape(wp_get_referer()); $title = __('WordPress Confirmation'); // Remove extra layer of slashes. @@ -1207,7 +1207,7 @@ $html .= "\t\t\n"; $html .= "\t\t
" . wp_specialchars(wp_explain_nonce($action)) . "
\n\t\t\n\t\t" . wp_specialchars(wp_explain_nonce($action)) . "
\n\t\n\t" . wp_specialchars(wp_explain_nonce($action)) . "
\n\t\n\t