diff --git wp-includes/canonical.php wp-includes/canonical.php
index 423dcc6..6bc4c1d 100644
|
|
|
function redirect_canonical( $requested_url = null, $do_redirect = true ) { |
| 218 | 218 | $redirect['query'] = remove_query_arg( 'page', $redirect['query'] ); |
| 219 | 219 | } |
| 220 | 220 | |
| | 221 | // check for query vars other than feed that have values that match feed slugs |
| | 222 | $no_feed_vars = true; |
| | 223 | foreach ( $GLOBALS['wp']->query_vars as $var => $slug ) { |
| | 224 | if ( preg_match( '#^feed|rss2?|rdf|atom$#', $slug ) && 'feed' !== $var ) { |
| | 225 | $no_feed_vars = false; |
| | 226 | break; |
| | 227 | } |
| | 228 | } |
| | 229 | |
| 221 | 230 | // paging and feeds |
| 222 | | if ( get_query_var('paged') || is_feed() || get_query_var('cpage') ) { |
| | 231 | if ( get_query_var('paged') || ( is_feed() && $no_feed_vars ) || get_query_var('cpage') ) { |
| 223 | 232 | while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( '#/comment-page-[0-9]+(/+)?$#', $redirect['path'] ) ) { |
| 224 | 233 | // Strip off paging and feed |
| 225 | 234 | $redirect['path'] = preg_replace("#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing paging |