WordPress.org

Make WordPress Core

Ticket #24623: redirect_canonical_rss_rewrite_bug.patch

File redirect_canonical_rss_rewrite_bug.patch, 680 bytes (added by sweetie089, 21 months ago)
  • wp-includes/canonical.php

     
    337337                $redirect['query'] = trim(preg_replace( '#(^|&)(p|page_id|cat|tag)=?(&|$)#', '&', $redirect['query']), '&'); 
    338338 
    339339                // Redirect obsolete feeds 
    340                 $redirect['query'] = preg_replace( '#(^|&)feed=rss(&|$)#', '$1feed=rss2$3', $redirect['query'] ); 
     340                $redirect['query'] = preg_replace( '#(^|&)feed=rss(&|$)#', '$1feed=rss2$2', $redirect['query'] ); 
    341341 
    342342                // Remove redundant leading ampersands 
    343343                $redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] );