diff --git a/src/wp-includes/class-wp-comment-query.php b/src/wp-includes/class-wp-comment-query.php
index ccbf10c..a120b58 100644
--- a/src/wp-includes/class-wp-comment-query.php
+++ b/src/wp-includes/class-wp-comment-query.php
@@ -745,7 +745,7 @@ 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'] ) {
+		if ( ! in_array( $this->query_vars['search'], array( '', null, false ), true ) ) {
 			$search_sql = $this->get_search_sql(
 				$this->query_vars['search'],
 				array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' )
diff --git a/tests/phpunit/tests/comment/query.php b/tests/phpunit/tests/comment/query.php
index 88fe55e..e787dfc 100644
--- a/tests/phpunit/tests/comment/query.php
+++ b/tests/phpunit/tests/comment/query.php
@@ -1142,6 +1142,30 @@ class Tests_Comment_Query extends WP_UnitTestCase {
 		$this->assertEqualSets( array( $c1, $c2, $c3, $c4, $c5 ), $found );
 	}
 
+	public function test_search_falsy_arg() {
+		$q = new WP_Comment_Query();
+		$q->query( array(
+			'search' => false,
+		) );
+		$this->assertNotContains( "comment_author LIKE '%%'", $q->request );
+		$q->query( array(
+			'search' => null,
+		) );
+		$this->assertNotContains( "comment_author LIKE '%%'", $q->request );
+		$q->query( array(
+			'search' => '',
+		) );
+		$this->assertNotContains( "comment_author LIKE '%%'", $q->request );
+		$q->query( array(
+			'search' => 'foo',
+		) );
+		$this->assertContains( "comment_author LIKE '%foo%'", $q->request );
+		$q->query( array(
+			'search' => '0',
+		) );
+		$this->assertContains( "comment_author LIKE '%0%'", $q->request );
+	}
+
 	public function test_orderby_default() {
 		global $wpdb;
 
