Make WordPress Core


Ignore:
Timestamp:
09/23/2015 02:08:47 PM (11 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/getCommentClass.php

    r34453 r34454  
    3737                $this->assertContains( 'bar', $classes );
    3838        }
     39
     40        /**
     41         * @ticket 33947
     42         */
     43        public function test_should_return_an_empty_array_for_invalid_comment_id() {
     44                $this->assertSame( array(), get_comment_class( 'foo', 12345 ) );
     45        }
    3946}
Note: See TracChangeset for help on using the changeset viewer.