Ticket #10935: 10935.2.diff
| File 10935.2.diff, 2.0 KB (added by , 13 years ago) |
|---|
-
wp-includes/canonical.php
101 101 } 102 102 } 103 103 104 if ( get_query_var( 'day' ) && get_query_var( 'monthnum' ) && get_query_var( 'year' ) 105 && ! checkdate( get_query_var( 'monthnum' ), get_query_var( 'day' ), get_query_var( 'year' ) ) ) { 106 $redirect_url = get_month_link( get_query_var( 'year' ), get_query_var( 'monthnum' ) ); 107 $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'year', 'monthnum', 'day' ), $redirect_url ); 108 } elseif ( get_query_var( 'monthnum' ) && get_query_var( 'year' ) && 12 < get_query_var( 'monthnum' ) ) { 109 $redirect_url = get_year_link( get_query_var( 'year' ) ); 110 $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'year', 'monthnum' ), $redirect_url ); 111 } 112 104 113 if ( ! $redirect_url ) { 105 114 if ( $redirect_url = redirect_guess_404_permalink() ) { 106 115 $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'page', 'feed', 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url ); -
wp-includes/query.php
1501 1501 1502 1502 if ( $qv['day'] ) { 1503 1503 if ( ! $this->is_date ) { 1504 $this->is_day = true; 1505 $this->is_date = true; 1504 if ( $qv['monthnum'] && $qv['year'] && ! checkdate( $qv['monthnum'], $qv['day'], $qv['year'] ) ) { 1505 $qv['error'] = '404'; 1506 } else { 1507 $this->is_day = true; 1508 $this->is_date = true; 1509 } 1506 1510 } 1507 1511 } 1508 1512 1509 1513 if ( $qv['monthnum'] ) { 1510 1514 if ( ! $this->is_date ) { 1511 $this->is_month = true; 1512 $this->is_date = true; 1515 if ( 12 < $qv['monthnum'] ) { 1516 $qv['error'] = '404'; 1517 } else { 1518 $this->is_month = true; 1519 $this->is_date = true; 1520 } 1513 1521 } 1514 1522 } 1515 1523