Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Strip /feed/ endings even if they are not at the very end, in canonic…

…al. props jhodgdon. fixes #8642 for 2.7

git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
commit 6c57fae8297ab9f66334419bdc3cecc3164fb3f5 1 parent 3d8cd59
markjaquith authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  wp-includes/canonical.php
View
2  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
}
Please sign in to comment.
Something went wrong with that request. Please try again.