Changeset 35853
- Timestamp:
- 12/10/2015 03:16:51 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r35745 r35853 1905 1905 1906 1906 // Make sure that the comment post ID is valid (if specified). 1907 if ( isset( $commentarr['comment_post_ID'] ) && ! get_post( $commentarr['comment_post_ID'] ) ) {1907 if ( ! empty( $commentarr['comment_post_ID'] ) && ! get_post( $commentarr['comment_post_ID'] ) ) { 1908 1908 return 0; 1909 1909 } -
trunk/tests/phpunit/tests/comment.php
r35475 r35853 71 71 } 72 72 73 /** 74 * @ticket 34954 75 */ 76 function test_wp_update_comment_with_no_post_id() { 77 $comment_id = self::factory()->comment->create( array( 'comment_post_ID' => 0 ) ); 78 79 $updated_comment_text = 'I should be able to update a comment with a Post ID of zero'; 80 81 $update = wp_update_comment( array( 'comment_ID' => $comment_id, 'comment_content' => $updated_comment_text, 'comment_post_ID' => 0 ) ); 82 $this->assertSame( 1, $update ); 83 84 $comment = get_comment( $comment_id ); 85 $this->assertEquals( $updated_comment_text, $comment->comment_content ); 86 } 87 73 88 public function test_get_approved_comments() { 74 89 $ca1 = self::factory()->comment->create( array(
Note: See TracChangeset
for help on using the changeset viewer.