From b5f68df374ef2935bec24067d7c60901d914f699 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 4 Feb 2009 23:07:41 +0000 Subject: [PATCH] Strip /feed/ endings even if they are not at the very end, in canonical. props jhodgdon. fixes #8642 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@10505 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/canonical.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index 8ae4bf511e..c17e2f1325 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -136,7 +136,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { while ( preg_match( '#/page/[0-9]+?(/+)?$#', $paged_redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $paged_redirect['path'] ) || preg_match( '#/comment-page-[0-9]+(/+)?$#', $paged_redirect['path'] ) ) { // Strip off paging and feed $paged_redirect['path'] = preg_replace('#/page/[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing paging - $paged_redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+)?$#', '/', $paged_redirect['path']); // strip off feed endings + $paged_redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $paged_redirect['path']); // strip off feed endings $paged_redirect['path'] = preg_replace('#/comment-page-[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing comment paging }