mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Code Modernization: Fix "passing null to non-nullable" deprecation notice in WP_Comment_Query::get_comment_ids()
.
The `WP_Comment_Query::get_comment_ids()` method is supposed to handle `null` as a search query, but was throwing a `strlen(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1. Discovered via and already covered via the pre-existing `Tests_Comment_Query::test_search_null_should_be_ignored()` test method. Follow-up to [36345], [48275]. Props jrf, hellofromTonya. See #53635. Built from https://develop.svn.wordpress.org/trunk@51806 git-svn-id: http://core.svn.wordpress.org/trunk@51413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
65ff35bb75
commit
e838c96df4
@ -801,7 +801,7 @@ class WP_Comment_Query {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Falsey search strings are ignored.
|
// Falsey search strings are ignored.
|
||||||
if ( strlen( $this->query_vars['search'] ) ) {
|
if ( isset( $this->query_vars['search'] ) && strlen( $this->query_vars['search'] ) ) {
|
||||||
$search_sql = $this->get_search_sql(
|
$search_sql = $this->get_search_sql(
|
||||||
$this->query_vars['search'],
|
$this->query_vars['search'],
|
||||||
array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' )
|
array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' )
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.9-alpha-51805';
|
$wp_version = '5.9-alpha-51806';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user