From 69a4f35a7b00d86e7ca0b774ce567f3b9705a0b2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 26 Feb 2022 14:32:37 +0000 Subject: [PATCH] Query: Correct the "matched rule" condition in `WP::parse_request()`. The `WP::$matched_rule` property is always set now, so we should check that it's not empty instead. Follow-up to [52804]. See #55222. git-svn-id: https://develop.svn.wordpress.org/trunk@52805 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php index 6eb6177c09..9765a01507 100644 --- a/src/wp-includes/class-wp.php +++ b/src/wp-includes/class-wp.php @@ -252,7 +252,7 @@ class WP { } } - if ( isset( $this->matched_rule ) ) { + if ( ! empty( $this->matched_rule ) ) { // Trim the query of everything up to the '?'. $query = preg_replace( '!^.+\?!', '', $query );