Ticket #21700: allow-feedmatching-query-vars.diff
File allow-feedmatching-query-vars.diff, 1.3 KB (added by , 13 years ago) |
---|
-
wp-includes/canonical.php
217 217 $redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' ); 218 218 $redirect['query'] = remove_query_arg( 'page', $redirect['query'] ); 219 219 } 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 } 220 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