Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#29250 closed defect (bug) (invalid)

wp_kses() fails to allow HTML time tag

Reported by: henrywright's profile henry.wright Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.2
Component: Formatting Keywords:
Focuses: Cc:

Description

The <time> tag gets stripped even when I try to use it as an allowed HTML element in wp_kses(). For example:

function my_strip_tags( $content, $comment ) {
    
    $allowed_html = array(
        'time' => array(
            'datetime' => array()
        )
    );
    
    $content = wp_kses( $content, $allowed_html );
    return $content;
}
add_filter( 'comment_text', 'my_strip_tags', 10, 2 );

Ref: http://codex.wordpress.org/Function_Reference/wp_kses

Change History (3)

#1 @DrewAPicture
10 years ago

  • Component changed from General to Formatting

#2 @miqrogroove
10 years ago

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

If you check the value of $content directly before and after the call to wp_kses(), I think you will find the value is modified as expected.

Unless you can identify a core bug here, please use the support areas to get help troubleshooting your own code.

#3 @DrewAPicture
10 years ago

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