From bcf5ab6307224e3e91c85c28f6025a0eb19b5f00 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 13 Feb 2010 00:11:23 +0000 Subject: [PATCH] Strip out multiple slashes on non-post URL's. See #8948 git-svn-id: https://develop.svn.wordpress.org/trunk@13072 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/canonical.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index 5c03bb4a86..c57addf914 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -255,6 +255,10 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $redirect['path'] = trailingslashit($redirect['path']); } + // Strip multiple slashes out of the URL + if ( strpos($original['path'], '//') > -1 ) + $redirect['path'] = preg_replace('|/+|', '/', $original['path']); + // Always trailing slash the Front Page URL if ( trailingslashit( $redirect['path'] ) == trailingslashit( $user_home['path'] ) ) $redirect['path'] = trailingslashit($redirect['path']);