diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php
index bc673191a8..a6ded6cf1e 100644
a
|
b
|
class WP_Query { |
1015 | 1015 | $this->is_admin = true; |
1016 | 1016 | } |
1017 | 1017 | |
1018 | | if ( str_contains( $qv['feed'], 'comments-' ) ) { |
| 1018 | if ( is_string( $qv['feed'] ) && str_contains( $qv['feed'], 'comments-' ) ) { |
1019 | 1019 | $qv['feed'] = str_replace( 'comments-', '', $qv['feed'] ); |
1020 | 1020 | $qv['withcomments'] = 1; |
1021 | 1021 | } |
diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php
index ce88c102cf..c5b2dbb66b 100644
a
|
b
|
class WP { |
469 | 469 | } else { |
470 | 470 | // Set the correct content type for feeds. |
471 | 471 | $type = $this->query_vars['feed']; |
| 472 | |
| 473 | // Ensure $type is a string |
| 474 | if ( ! is_string( $type ) ) { |
| 475 | $type = get_default_feed(); |
| 476 | } |
| 477 | |
472 | 478 | if ( 'feed' === $this->query_vars['feed'] ) { |
473 | 479 | $type = get_default_feed(); |
474 | 480 | } |
… |
… |
class WP { |
477 | 483 | |
478 | 484 | // We're showing a feed, so WP is indeed the only thing that last changed. |
479 | 485 | if ( ! empty( $this->query_vars['withcomments'] ) |
480 | | || str_contains( $this->query_vars['feed'], 'comments-' ) |
| 486 | || ( is_string( $this->query_vars['feed'] ) && str_contains( $this->query_vars['feed'], 'comments-' ) ) |
481 | 487 | || ( empty( $this->query_vars['withoutcomments'] ) |
482 | 488 | && ( ! empty( $this->query_vars['p'] ) |
483 | 489 | || ! empty( $this->query_vars['name'] ) |