--- web/wp/wp-includes/canonical.php 2016-02-10 22:55:34.000000000 +0100 +++ ../ixina-be/web/wp/wp-includes/canonical.php 2013-12-24 19:57:12.000000000 +0100 @@ -234,11 +234,10 @@ // paging and feeds if ( get_query_var('paged') || is_feed() || get_query_var('cpage') ) { - $feedssubpattern = implode('|', array_map(function($val) { return preg_quote($val, '#'); }, $wp_rewrite->feeds)); - while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(' . $feedssubpattern . ')(/+)?$#', $redirect['path'] ) || preg_match( '#/comment-page-[0-9]+(/+)?$#', $redirect['path'] ) ) { + 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'] ) ) { // Strip off paging and feed $redirect['path'] = preg_replace("#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing paging - $redirect['path'] = preg_replace('#/(comments/?)?(' . $feedssubpattern . ')(/+|$)#', '/', $redirect['path']); // strip off feed endings + $redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path']); // strip off feed endings $redirect['path'] = preg_replace('#/comment-page-[0-9]+?(/+)?$#', '/', $redirect['path']); // strip off any existing comment paging }