Strip out multiple slashes on non-post URL's. See #8948

git-svn-id: http://svn.automattic.com/wordpress/trunk@13072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-02-13 00:11:23 +00:00
parent 6a4a3631e3
commit c7253edea9

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