diff --git src/wp-includes/kses.php src/wp-includes/kses.php
index d34608b..668efd9 100644
|
|
function wp_kses_hair($attr, $allowed_protocols) { |
927 | 927 | switch ($mode) { |
928 | 928 | case 0 : // attribute name, href for instance |
929 | 929 | |
930 | | if ( preg_match('/^([-a-zA-Z:]+)/', $attr, $match ) ) { |
| 930 | if ( preg_match('/^([-_a-zA-Z0-9:]+)/', $attr, $match ) ) { |
931 | 931 | $attrname = $match[1]; |
932 | 932 | $working = $mode = 1; |
933 | | $attr = preg_replace( '/^[-a-zA-Z:]+/', '', $attr ); |
| 933 | $attr = preg_replace( '/^[-_a-zA-Z0-9:]+/', '', $attr ); |
934 | 934 | } |
935 | 935 | |
936 | 936 | break; |
diff --git tests/phpunit/tests/kses.php tests/phpunit/tests/kses.php
index c4c1e8e..69153e5 100644
|
|
EOF; |
653 | 653 | |
654 | 654 | $this->assertEquals( $input, wp_kses( $input, $allowedposttags ) ); |
655 | 655 | } |
| 656 | |
| 657 | /** |
| 658 | * Test wp_kses_hair(). |
| 659 | * |
| 660 | * @ticket 34406 |
| 661 | * |
| 662 | * @dataProvider data_hair |
| 663 | */ |
| 664 | function test_hair( $input, $output, $allowed ) { |
| 665 | return $this->assertEquals( $output, wp_kses( $input, $allowed ) ); |
| 666 | } |
| 667 | |
| 668 | function data_hair() { |
| 669 | |
| 670 | global $allowedposttags; |
| 671 | $allowedposttags['img']['data_at:2x'] = true; |
| 672 | |
| 673 | return array( |
| 674 | array( |
| 675 | '<img src="" data_at:2x="" alt="blah" />', |
| 676 | '<img src="" data_at:2x="" alt="blah" />', |
| 677 | $allowedposttags, |
| 678 | ), |
| 679 | array( |
| 680 | '<img src="" data_at:2x="" alt="blah" />', |
| 681 | '<img src="" data_at:2x="" alt="blah" />', |
| 682 | $allowedposttags, |
| 683 | ), |
| 684 | array( |
| 685 | '<img src="" data&="" alt="blah" />', |
| 686 | '<img src="" alt="blah" />', |
| 687 | $allowedposttags, |
| 688 | ), |
| 689 | array( |
| 690 | '<img src="" data%="" alt="blah" />', |
| 691 | '<img src="" alt="blah" />', |
| 692 | $allowedposttags, |
| 693 | ), |
| 694 | ); |
| 695 | } |
656 | 696 | } |