mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Bail early when invalid ID is passed to get_comment_class().
This helps to avoid PHP notices later in the function. Props walterebert, dipesh.kakadiya, DrewAPicture. Fixes #33947. git-svn-id: https://develop.svn.wordpress.org/trunk@34454 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -36,4 +36,11 @@ class Tests_Comment_GetCommentClass extends WP_UnitTestCase {
|
||||
$this->assertContains( 'foo', $classes );
|
||||
$this->assertContains( 'bar', $classes );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 33947
|
||||
*/
|
||||
public function test_should_return_an_empty_array_for_invalid_comment_id() {
|
||||
$this->assertSame( array(), get_comment_class( 'foo', 12345 ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user