From 1f3ce09d523d59d6394ae2db3d2a3e1921965b55 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 12 Sep 2007 20:44:41 +0000 Subject: [PATCH] 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 --- wp-includes/canonical.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index ac74e6218e..2d0e5b7c89 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -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'] )