diff --git a/wp-includes/vars.php b/wp-includes/vars.php index 5f9257e85a..e285ed8321 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -29,9 +29,11 @@ if ( is_admin() ) { } else { preg_match( '#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches ); } - $pagenow = $self_matches[1]; + + $pagenow = ! empty( $self_matches[1] ) ? $self_matches[1] : ''; $pagenow = trim( $pagenow, '/' ); $pagenow = preg_replace( '#\?.*?$#', '', $pagenow ); + if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) { $pagenow = 'index.php'; } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index 463039a4d7..58ae7ba8ea 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-beta3-53293'; +$wp_version = '6.0-beta3-53294'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.