Make WordPress Core

Ticket #33259: 33259.diff

File 33259.diff, 1.0 KB (added by obenland, 10 years ago)
  • src/wp-includes/shortcodes.php

     
    394394                                if ( $count > 0 ) {
    395395                                        // Sanitize the shortcode output using KSES.
    396396                                        $new_attr = wp_kses_one_attr( $new_attr, $elname );
    397                                         if ( '' !== $new_attr ) {
     397                                        if ( '' !== trim( $new_attr ) ) {
    398398                                                // The shortcode is safe to use now.
    399399                                                $attr = $new_attr;
    400400                                        }
  • tests/phpunit/tests/shortcode.php

     
    419419                                '<!--[if lt IE 7]>',
    420420                        ),
    421421                        array(
     422                                '1 <a href="[test-shortcode-tag]"> 2 <a href="[test-shortcode-tag]" >',
     423                                '1 <a href="[test-shortcode-tag]"> 2 <a href="[test-shortcode-tag]" >',
     424                        ),
     425                        array(
    422426                                '[gallery title="<div>hello</div>"]',
    423427                                '',
    424428                        ),