Ignore false values of 'search' in WP_Comment_Query.

Props danielbachhuber.
Fixes #35513.

git-svn-id: https://develop.svn.wordpress.org/trunk@36345 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2016-01-19 02:54:28 +00:00
parent 43da0d3894
commit 1b8e03bd89
2 changed files with 57 additions and 1 deletions
+2 -1
View File
@@ -745,7 +745,8 @@ class WP_Comment_Query {
$this->sql_clauses['where']['user_id'] = $wpdb->prepare( 'user_id = %d', $this->query_vars['user_id'] );
}
if ( '' !== $this->query_vars['search'] ) {
// Falsy search strings are ignored.
if ( strlen( $this->query_vars['search'] ) ) {
$search_sql = $this->get_search_sql(
$this->query_vars['search'],
array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' )