mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
KSES: Support 'tag' => true as a shorthand for 'tag' => array() in wp_kses_attr().
`Automatic_Upgrader_Skin::feedback()` had always assumed that this is already the case, now it is. See #20017. Fixes #40680. git-svn-id: https://develop.svn.wordpress.org/trunk@40637 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -678,4 +678,34 @@ EOF;
|
||||
|
||||
$this->assertEquals( $input, wp_kses( $input, $allowedposttags ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 40680
|
||||
*/
|
||||
function test_wp_kses_attr_no_attributes_allowed_with_empty_array() {
|
||||
$element = 'foo';
|
||||
$attribute = 'title="foo" class="bar"';
|
||||
|
||||
$this->assertEquals( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => array() ), array() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 40680
|
||||
*/
|
||||
function test_wp_kses_attr_no_attributes_allowed_with_true() {
|
||||
$element = 'foo';
|
||||
$attribute = 'title="foo" class="bar"';
|
||||
|
||||
$this->assertEquals( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => true ), array() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 40680
|
||||
*/
|
||||
function test_wp_kses_attr_single_attribute_is_allowed() {
|
||||
$element = 'foo';
|
||||
$attribute = 'title="foo" class="bar"';
|
||||
|
||||
$this->assertEquals( "<{$element} title=\"foo\">", wp_kses_attr( $element, $attribute, array( 'foo' => array( 'title' => true ) ), array() ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user