diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php index a996b86a91..5310f0caf9 100644 --- a/src/wp-includes/kses.php +++ b/src/wp-includes/kses.php @@ -252,6 +252,12 @@ if ( ! CUSTOM_TAGS ) { 'align' => true, 'value' => true, ), + 'main' => array( + 'align' => true, + 'dir' => true, + 'lang' => true, + 'xml:lang' => true, + ), 'map' => array( 'name' => true, ), diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php index a620d491f7..1d5dfdff60 100644 --- a/tests/phpunit/tests/kses.php +++ b/tests/phpunit/tests/kses.php @@ -1478,4 +1478,22 @@ EOF; $this->assertSame( $html, wp_kses_post( $html ) ); } + + /** + * Test filtering a standard main tag. + * + * @ticket 53156 + */ + function test_wp_kses_main_tag_standard_attributes() { + $test = array( + '', + ); + + $html = implode( ' ', $test ); + + $this->assertSame( $html, wp_kses_post( $html ) ); + } }