Ticket #21602: 21602.patch
File 21602.patch, 1.5 KB (added by , 12 years ago) |
---|
-
wp-includes/canonical.php
374 374 if ( trailingslashit( $redirect['path'] ) == trailingslashit( $user_home['path'] ) ) 375 375 $redirect['path'] = trailingslashit($redirect['path']); 376 376 377 // Ignore differences in host capitalization, as this can lead to infinite redirects378 // Only redirect no-www <=> yes-www379 if ( strtolower($original['host']) == strtolower($redirect['host']) ||380 ( strtolower($original['host']) != 'www.' . strtolower($redirect['host']) && 'www.' . strtolower($original['host']) != strtolower($redirect['host']) ) )381 $redirect['host'] = $original['host'];382 383 377 $compare_original = array($original['host'], $original['path']); 384 378 385 379 if ( !empty( $original['port'] ) ) … … 396 390 if ( !empty( $redirect['query'] ) ) 397 391 $compare_redirect[] = $redirect['query']; 398 392 393 // Ignore differences in host capitalization, as this can lead to infinite redirects 394 // Only redirect no-www <=> yes-www 395 if ( strtolower($original['host']) == strtolower($redirect['host']) || 396 ( strtolower($original['host']) != 'www.' . strtolower($redirect['host']) && 'www.' . strtolower($original['host']) != strtolower($redirect['host']) ) ) 397 $redirect['host'] = $original['host']; 398 399 399 if ( $compare_original !== $compare_redirect ) { 400 400 $redirect_url = $redirect['scheme'] . '://' . $redirect['host']; 401 401 if ( !empty($redirect['port']) )