git-svn-id: https://develop.svn.wordpress.org/trunk@9203 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d806f2e97d
commit
6f68542aef
|
@ -54,7 +54,10 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Some PHP setups turn requests for / into /index.php in REQUEST_URI
|
// Some PHP setups turn requests for / into /index.php in REQUEST_URI
|
||||||
$original['path'] = preg_replace('|/index\.php$|', '/', $original['path']);
|
// See: http://trac.wordpress.org/ticket/5017
|
||||||
|
// See: http://trac.wordpress.org/ticket/7173
|
||||||
|
// Disabled, for now:
|
||||||
|
// $original['path'] = preg_replace('|/index\.php$|', '/', $original['path']);
|
||||||
|
|
||||||
$redirect = $original;
|
$redirect = $original;
|
||||||
$redirect_url = false;
|
$redirect_url = false;
|
||||||
|
@ -177,8 +180,8 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
|
||||||
else
|
else
|
||||||
unset($redirect['port']);
|
unset($redirect['port']);
|
||||||
|
|
||||||
// trailing /index.php/
|
// trailing /index.php
|
||||||
$redirect['path'] = preg_replace('|/index.php/$|', '/', $redirect['path']);
|
$redirect['path'] = preg_replace('|/index.php/*?$|', '/', $redirect['path']);
|
||||||
|
|
||||||
// Remove trailing spaces from the path
|
// Remove trailing spaces from the path
|
||||||
$redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] );
|
$redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] );
|
||||||
|
|
Loading…
Reference in New Issue