#44549 closed defect (bug) (invalid)
Error : [] operator not supported for strings
Reported by: | conner_bw | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9.7 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
This function:
function wp_kses_post( $data ) {
return wp_kses( $data, 'post' );
}
Doesn't work because the second parameter is a string but wp_kses() expects an array.
* @param string $string Content to filter through kses
* @param array $allowed_html List of allowed HTML elements
* @param array $allowed_protocols Optional. Allowed protocol in links.
* @return string Filtered content with only allowed HTML elements
*/
function wp_kses( $string, $allowed_html, $allowed_protocols = array() ) {
We get:
Error : [] operator not supported for strings /tmp/wordpress/wp-includes/plugin.php:195 /tmp/wordpress/wp-includes/kses.php:688 /tmp/wordpress/wp-includes/kses.php:531 /tmp/wordpress/wp-includes/kses.php:1576
Change History (2)
Note: See
TracTickets for help on using
tickets.
No bug.
Unit test out of order, didn't init $wp_current_filter correctly.