Make WordPress Core

Ticket #33259: 33259.2.diff

File 33259.2.diff, 1.1 KB (added by miqrogroove, 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=""> 2 <a href="" >',
     424                        ),
     425                        array(
     426                                '1 <a noise="[test-shortcode-tag]"> 2 <a noise=" [test-shortcode-tag] " >',
     427                                '1 <a noise="[test-shortcode-tag]"> 2 <a noise=" [test-shortcode-tag] " >',
     428                        ),
     429                        array(
    422430                                '[gallery title="<div>hello</div>"]',
    423431                                '',
    424432                        ),