From 88c31f17b1dae4eb9461226f655558215f8ee010 Mon Sep 17 00:00:00 2001 From: Mark Jaquith 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: https://develop.svn.wordpress.org/trunk@6097 602fd350-edb4-49c9-b593-d223f7449a82 --- 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'] )