From e35b1c1a0b69ec9ec481a3c488a074e16ab1cae8 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 16 Oct 2008 21:14:42 +0000 Subject: [PATCH] Proper trailing slashes for when is_front_page() does not show the blog. fixes #7892 git-svn-id: https://develop.svn.wordpress.org/trunk@9214 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/canonical.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index a2c0a19635..aa788f9c5f 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -199,12 +199,12 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $redirect['path'] = str_replace('/index.php/', '/', $redirect['path']); // trailing slashes - if ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() && !is_404() && (!is_home() || ( is_home() && (get_query_var('paged') > 1) ) ) ) { + if ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() && !is_404() && (!is_front_page() || ( is_front_page() && (get_query_var('paged') > 1) ) ) ) { $user_ts_type = ''; if ( get_query_var('paged') > 0 ) { $user_ts_type = 'paged'; } else { - foreach ( array('single', 'category', 'page', 'day', 'month', 'year') as $type ) { + foreach ( array('single', 'category', 'page', 'day', 'month', 'year', 'home') as $type ) { $func = 'is_' . $type; if ( call_user_func($func) ) { $user_ts_type = $type; @@ -213,12 +213,12 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { } } $redirect['path'] = user_trailingslashit($redirect['path'], $user_ts_type); - } elseif ( is_home() ) { + } elseif ( is_front_page() ) { $redirect['path'] = trailingslashit($redirect['path']); } - // Always trailing slash the 'home' URL - if ( $redirect['path'] == $user_home['path'] ) + // Always trailing slash the Front Page URL + if ( trailingslashit( $redirect['path'] ) == trailingslashit( $user_home['path'] ) ) $redirect['path'] = trailingslashit($redirect['path']); // Ignore differences in host capitalization, as this can lead to infinite redirects