[wp-trac] [WordPress Trac] #44113: Add `esc_html` to assertion in test_wp_comments_personal_data_exporter

WordPress Trac noreply at wordpress.org
Wed May 16 16:01:50 UTC 2018


#44113: Add `esc_html` to assertion in test_wp_comments_personal_data_exporter
--------------------------+-----------------------------
 Reporter:  mermel        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:  trunk
 Severity:  minor         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The line in
 [https://core.trac.wordpress.org/browser/branches/4.9/tests/phpunit/tests/comment.php#L1008
 `test_wp_comments_personal_data_exporter]:

 `$this->assertSame( get_comment_link( $comment_id ), strip_tags(
 $actual['data'][0]['data'][7]['value'] ) );`

 needs to be updated to:

 `$this->assertSame( esc_html( get_comment_link( $comment_id ) ),
 strip_tags( $actual['data'][0]['data'][7]['value'] ) );`.

 This is due to [https://core.trac.wordpress.org/changeset/43270/ this
 change] in 4.9.6 which escapes comment URLs in personal export files.  The
 test is not currently failing because there is nothing to escape in the
 provided test link.  If an install is configured to allow cpage as an arg
 and an ampersand is added to the link, this test will fail.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44113>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list