Ticket #4967: 4967.4.diff
File 4967.4.diff, 3.1 KB (added by , 13 years ago) |
---|
-
wp-includes/default-filters.php
234 234 add_action( 'sanitize_comment_cookies', 'wp_cron' ); 235 235 236 236 // 2 Actions 2 Furious 237 add_action( 'do_feed_rdf', 'do_feed_r df',10, 1 );238 add_action( 'do_feed_rss', 'do_feed_rss ',10, 1 );237 add_action( 'do_feed_rdf', 'do_feed_rss2', 10, 1 ); 238 add_action( 'do_feed_rss', 'do_feed_rss2', 10, 1 ); 239 239 add_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 ); 240 240 add_action( 'do_feed_atom', 'do_feed_atom', 10, 1 ); 241 241 add_action( 'do_pings', 'do_all_pings', 10, 1 ); -
wp-includes/canonical.php
206 206 207 207 // paging and feeds 208 208 if ( get_query_var('paged') || is_feed() || get_query_var('cpage') ) { 209 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'] ) ) {209 while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( '#/comment-page-[0-9]+(/+)?$#', $redirect['path'] ) ) { 210 210 // Strip off paging and feed 211 211 $redirect['path'] = preg_replace("#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing paging 212 $redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2 ?|rdf|atom)(/+|$)#', '/', $redirect['path']); // strip off feed endings212 $redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2|atom)(/+|$)#', '/', $redirect['path']); // strip off feed endings 213 213 $redirect['path'] = preg_replace('#/comment-page-[0-9]+?(/+)?$#', '/', $redirect['path']); // strip off any existing comment paging 214 214 } 215 215 … … 218 218 $addl_path = !empty( $addl_path ) ? trailingslashit($addl_path) : ''; 219 219 if ( get_query_var( 'withcomments' ) ) 220 220 $addl_path .= 'comments/'; 221 $addl_path .= user_trailingslashit( 'feed/' . ( ( get_default_feed() == get_query_var('feed') || 'feed' == get_query_var('feed') ) ? '' : get_query_var('feed') ), 'feed' ); 221 if( (in_array( get_default_feed(), array( 'rss', 'rdf' ) ) && 'feed' == get_query_var('feed')) || in_array( get_query_var('feed'), array( 'rss', 'rdf' ) ) ){ 222 $addl_path .= user_trailingslashit( 'feed/' . ( get_default_feed() == 'rss2' ) ? '' : 'rss2', 'feed' ); 223 }else{ 224 $addl_path .= user_trailingslashit( 'feed/' . ( ( get_default_feed() == get_query_var('feed') || 'feed' == get_query_var('feed') ) ? '' : get_query_var('feed') ), 'feed' ); 225 } 222 226 $redirect['query'] = remove_query_arg( 'feed', $redirect['query'] ); 223 227 } 224 228