### Eclipse Workspace Patch 1.0
#P wordpress-trunk
Index: wp-includes/classes.php
===================================================================
--- wp-includes/classes.php	(revision 12559)
+++ wp-includes/classes.php	(working copy)
@@ -461,17 +461,17 @@
 
 		if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
 			// Don't 404 for these queries if they matched an object.
-			if ( ( is_tag() || is_category() || is_author() ) && $wp_query->get_queried_object() ) {
-				if ( !is_404() )
-					status_header( 200 );
-				return;
+			if ( !( ( is_tag() || is_category() || is_author() ) && $wp_query->get_queried_object() ) ) {
+				if ( apply_filters( 'handle_404', $handle_404 ) ) {
+					$wp_query->set_404();
+					status_header( 404 );
+					nocache_headers();
+				}
 			}
-			$wp_query->set_404();
-			status_header( 404 );
-			nocache_headers();
-		} elseif ( !is_404() ) {
+		}
+
+		if ( !is_404() )
 			status_header( 200 );
-		}
 	}
 
 	/**
