mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Ignore HOST capitalization differences for canonical redirects. props jbctech. fixes #4773
git-svn-id: http://svn.automattic.com/wordpress/trunk@6097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d1acf020b5
commit
1f3ce09d52
@ -132,6 +132,10 @@ if ( $redirect_url )
|
||||
if ( $redirect['path'] == $user_home['path'] )
|
||||
$redirect['path'] = trailingslashit($redirect['path']);
|
||||
|
||||
// Ignore differences in host capitalization, as this can lead to infinite redirects
|
||||
if ( strtolower($original['host']) == strtolower($redirect['host']) )
|
||||
$redirect['host'] = $original['host'];
|
||||
|
||||
if ( array($original['host'], $original['path'], $original['query']) !== array($redirect['host'], $redirect['path'], $redirect['query']) ) {
|
||||
$redirect_url = $redirect['scheme'] . '://' . $redirect['host'] . $redirect['path'];
|
||||
if ( $redirect['query'] )
|
||||
|
Loading…
Reference in New Issue
Block a user