Skip to content

Commit d6f6780

Browse files
committed
KSES: Add tabindex to the list of allowed global attributes.
Add `tabindex` to the list of global attributes allowed by `_wp_add_global_attributes()`, so it survives KSES filtering on any element that supports global attributes. Developed in: WordPress#12493 Props ramonopoly, wildworks. Fixes #65619. git-svn-id: https://develop.svn.wordpress.org/trunk@62708 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 320cf61 commit d6f6780

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/wp-includes/kses.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,6 +2960,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
29602960
* @since 6.0.0 Added `dir`, `lang`, and `xml:lang` to global attributes.
29612961
* @since 6.3.0 Added `aria-controls`, `aria-current`, and `aria-expanded` attributes.
29622962
* @since 6.4.0 Added `aria-live` and `hidden` attributes.
2963+
* @since 7.1.0 Added `tabindex` attribute.
29632964
*
29642965
* @access private
29652966
* @ignore
@@ -2985,6 +2986,7 @@ function _wp_add_global_attributes( $value ) {
29852986
'id' => true,
29862987
'lang' => true,
29872988
'style' => true,
2989+
'tabindex' => true,
29882990
'title' => true,
29892991
'role' => true,
29902992
'xml:lang' => true,

tests/phpunit/tests/kses.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ public function test_wp_kses_allowed_html() {
497497
$this->assertTrue( $tag['id'] );
498498
$this->assertTrue( $tag['lang'] );
499499
$this->assertTrue( $tag['style'] );
500+
$this->assertTrue( $tag['tabindex'] );
500501
$this->assertTrue( $tag['title'] );
501502
$this->assertTrue( $tag['xml:lang'] );
502503
}

0 commit comments

Comments
 (0)