Changeset 18537
- Timestamp:
- 08/11/2011 11:30:59 PM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/canonical.php
r18254 r18537 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' ); 222 225 $redirect['query'] = remove_query_arg( 'feed', $redirect['query'] ); 223 226 } … … 296 299 $redirect['query'] = trim(preg_replace( '#(^|&)(p|page_id|cat|tag)=?(&|$)#', '&', $redirect['query']), '&'); 297 300 301 // Redirect obsolete feeds 302 $redirect['query'] = preg_replace( '#(^|&)feed=(rss|rdf)(&|$)#', '$1feed=rss2$3', $redirect['query'] ); 303 298 304 // Remove redundant leading ampersands 299 305 $redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] ); -
trunk/wp-includes/feed.php
r16660 r18537 64 64 */ 65 65 function get_default_feed() { 66 return apply_filters('default_feed', 'rss2'); 66 $default_feed = apply_filters('default_feed', 'rss2'); 67 return in_array( $default_feed, array( 'rss', 'rdf' ) ) ? 'rss2' : $default_feed; 67 68 } 68 69
Note: See TracChangeset
for help on using the changeset viewer.