Changes in trunk/wp-includes/class-wp.php [19280:19935]
- File:
-
- 1 edited
-
trunk/wp-includes/class-wp.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp.php
r19280 r19935 16 16 * @var array 17 17 */ 18 var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', ' debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type');18 var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type'); 19 19 20 20 /** … … 157 157 158 158 // Trim path info from the end and the leading home path from the 159 // front. For path info requests, this leaves us with the requesting160 // filename, if any. For 404 requests, this leaves us with the159 // front. For path info requests, this leaves us with the requesting 160 // filename, if any. For 404 requests, this leaves us with the 161 161 // requested permalink. 162 162 $req_uri = str_replace($pathinfo, '', $req_uri); … … 402 402 } 403 403 404 // query_string filter deprecated. Use request filter instead.404 // query_string filter deprecated. Use request filter instead. 405 405 if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in. 406 406 $this->query_string = apply_filters('query_string', $this->query_string); … … 475 475 global $wp_query; 476 476 477 if ( !is_admin() && ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) { 477 // If we've already issued a 404, bail. 478 if ( is_404() ) 479 return; 480 481 // Never 404 for the admin, robots, or if we found posts. 482 if ( is_admin() || is_robots() || $wp_query->posts ) { 483 status_header( 200 ); 484 return; 485 } 486 487 // We will 404 for paged queries, as no posts were found. 488 if ( ! is_paged() ) { 489 478 490 // Don't 404 for these queries if they matched an object. 479 if ( ( is_tag() || is_category() || is_tax() || is_author() || is_post_type_archive() ) && $wp_query->get_queried_object() && !is_paged() ) { 480 if ( !is_404() ) 481 status_header( 200 ); 491 if ( ( is_tag() || is_category() || is_tax() || is_author() || is_post_type_archive() ) && $wp_query->get_queried_object() ) { 492 status_header( 200 ); 482 493 return; 483 494 } 484 $wp_query->set_404(); 485 status_header( 404 ); 486 nocache_headers(); 487 } elseif ( !is_404() ) { 488 status_header( 200 ); 489 } 495 496 // Don't 404 for these queries either. 497 if ( is_home() || is_search() ) { 498 status_header( 200 ); 499 return; 500 } 501 } 502 503 // Guess it's time to 404. 504 $wp_query->set_404(); 505 status_header( 404 ); 506 nocache_headers(); 490 507 } 491 508 … … 602 619 603 620 } 604 605 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)