Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#44549 closed defect (bug) (invalid)

Error : [] operator not supported for strings

Reported by: conner_bw's profile conner_bw Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.7
Component: General Keywords:
Focuses: Cc:


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

Change History (2)

#1 @conner_bw
6 years ago

  • Resolution set to invalid
  • Status changed from new to closed

No bug.

Unit test out of order, didn't init $wp_current_filter correctly.

Last edited 6 years ago by conner_bw (previous) (diff)

#2 @netweb
6 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.