From 39b82b89be21af5b4a80deb82a6a022a697ac85c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 16 Apr 2019 15:34:52 +0000 Subject: [PATCH] Permalinks: Avoid a PHP notice in `wp_resolve_numeric_slug_conflicts()` when visiting a day archive with the `/%postname%/` permalink structure. Props thakkarhardik, thomstark. Fixes #46828. Built from https://develop.svn.wordpress.org/trunk@45214 git-svn-id: http://core.svn.wordpress.org/trunk@45023 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rewrite.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 71a83ac3e9..a03754f272 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -376,9 +376,9 @@ function wp_resolve_numeric_slug_conflicts( $query_vars = array() ) { $compare = ''; if ( 0 === $postname_index && ( isset( $query_vars['year'] ) || isset( $query_vars['monthnum'] ) ) ) { $compare = 'year'; - } elseif ( '%year%' === $permastructs[ $postname_index - 1 ] && ( isset( $query_vars['monthnum'] ) || isset( $query_vars['day'] ) ) ) { + } elseif ( $postname_index && '%year%' === $permastructs[ $postname_index - 1 ] && ( isset( $query_vars['monthnum'] ) || isset( $query_vars['day'] ) ) ) { $compare = 'monthnum'; - } elseif ( '%monthnum%' === $permastructs[ $postname_index - 1 ] && isset( $query_vars['day'] ) ) { + } elseif ( $postname_index && '%monthnum%' === $permastructs[ $postname_index - 1 ] && isset( $query_vars['day'] ) ) { $compare = 'day'; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 1fa749e98b..6bb8e19aa3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-beta3-45213'; +$wp_version = '5.2-beta3-45214'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.