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
This commit is contained in:
Dion Hulse 2010-02-13 00:11:23 +00:00
parent 3674f4a101
commit bcf5ab6307
1 changed files with 4 additions and 0 deletions

View File

@ -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']);