Changeset 7466
- Timestamp:
- 09/09/2026 07:18:03 AM (13 days ago)
- Location:
- branches/2.6
- Files:
-
- 3 edited
-
CHANGELOG.md (modified) (1 diff)
-
src/includes/core/filters.php (modified) (1 diff)
-
tests/phpunit/testcases/topics/template/topic-tag.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/CHANGELOG.md
r7464 r7466 28 28 ### Security 29 29 30 - Hardened topic-tag name output with consistent HTML escaping. 30 31 - Prevented topic-tag names from being interpreted as JavaScript in confirmation 31 32 prompts. -
branches/2.6/src/includes/core/filters.php
r7462 r7466 213 213 add_filter( 'bbp_get_topic_content', 'bbp_topic_content_append_revisions', 99, 2 ); 214 214 } 215 216 // Topic tag output - sanitize 217 add_filter( 'bbp_get_topic_tag_name', 'esc_html' ); 215 218 216 219 // Form textarea output - undo the code-trick done pre-save, and sanitize -
branches/2.6/tests/phpunit/testcases/topics/template/topic-tag.php
r5756 r7466 73 73 * @covers ::bbp_topic_tag_name 74 74 * @covers ::bbp_get_topic_tag_name 75 * @todo Implement test_bbp_get_topic_tag_name().76 75 */ 77 76 public function test_bbp_get_topic_tag_name() { 78 // Remove the following lines when you implement this test. 79 $this->markTestIncomplete( 80 'This test has not been implemented yet.' 77 $term = wp_insert_term( 78 'Rock & Roll\'s <tag>', 79 bbp_get_topic_tag_tax_id(), 80 array( 'slug' => 'rock-and-roll' ) 81 81 ); 82 83 $this->assertFalse( is_wp_error( $term ) ); 84 $topic_tag_name = bbp_get_topic_tag_name( 'rock-and-roll' ); 85 86 $this->assertSame( 'Rock & Roll's <tag>', $topic_tag_name ); 87 $this->assertSame( 'Rock & Roll's <tag>', esc_attr( $topic_tag_name ) ); 88 89 $filter = static function() { 90 return '<img src=x onerror=alert(document.domain)>'; 91 }; 92 93 add_filter( 'bbp_get_topic_tag_name', $filter, 9 ); 94 $topic_tag_name = bbp_get_topic_tag_name( 'rock-and-roll' ); 95 remove_filter( 'bbp_get_topic_tag_name', $filter, 9 ); 96 97 $this->assertSame( '<img src=x onerror=alert(document.domain)>', $topic_tag_name ); 82 98 } 83 99
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)