From 75cbfc25c7d2fb4fb52dde3f24b689dd9dbcbe21 Mon Sep 17 00:00:00 2001 From: Dovid Levine Date: Tue, 29 Oct 2024 10:39:07 +0200 Subject: [PATCH] fix: explicitly return false in magic `__isset()`s --- src/wp-includes/class-wp-comment.php | 2 ++ src/wp-includes/class-wp-query.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/wp-includes/class-wp-comment.php b/src/wp-includes/class-wp-comment.php index 996815939dfd0..c7c5227595f8d 100644 --- a/src/wp-includes/class-wp-comment.php +++ b/src/wp-includes/class-wp-comment.php @@ -359,6 +359,8 @@ public function __isset( $name ) { $post = get_post( $this->comment_post_ID ); return property_exists( $post, $name ); } + + return false; } /** diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index d25493dc5c4e1..bc673191a8a16 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/wp-includes/class-wp-query.php @@ -4011,6 +4011,8 @@ public function __isset( $name ) { if ( in_array( $name, $this->compat_fields, true ) ) { return isset( $this->$name ); } + + return false; } /**