Changeset 38511
- Timestamp:
- 09/02/2016 04:16:00 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/kses.php
r38121 r38511 782 782 // Allow HTML comments 783 783 784 if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9 ]+)([^>]*)>?$%', $string, $matches))784 if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9-]+)([^>]*)>?$%', $string, $matches)) 785 785 return ''; 786 786 // It's seriously malformed -
trunk/tests/phpunit/tests/kses.php
r35960 r38511 361 361 } 362 362 363 function test_hyphenated_tag() { 364 $string = "<hyphenated-tag attribute=\"value\" otherattribute=\"value2\">Alot of hyphens.</hyphenated-tag>"; 365 $custom_tags = array( 366 'hyphenated-tag' => array( 367 'attribute' => true, 368 ), 369 ); 370 $expect_stripped_string = 'Alot of hyphens.'; 371 372 $expect_valid_string = "<hyphenated-tag attribute=\"value\">Alot of hyphens.</hyphenated-tag>"; 373 $this->assertEquals( $expect_stripped_string, wp_kses_post( $string ) ); 374 $this->assertEquals( $expect_valid_string, wp_kses( $string, $custom_tags ) ); 375 } 376 363 377 /** 364 378 * @ticket 26290
Note: See TracChangeset
for help on using the changeset viewer.