Make WordPress Core

Ticket #33116: 33116.patch

File 33116.patch, 1.4 KB (added by miqrogroove, 8 years ago)
  • src/wp-includes/shortcodes.php

     
    378378
    379379                $attributes = wp_kses_attr_parse( $element );
    380380                if ( false === $attributes ) {
     381                        // Some plugins are doing weird things like [name] <[email]>.
     382                        if ( 1 === preg_match( '%^<\s*\[\[?[^\[\]]+\]%', $element ) ) {
     383                                $element = preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $element );
     384                        }
     385
    381386                        // Looks like we found some crazy unfiltered HTML.  Skipping it for sanity.
    382387                        $element = strtr( $element, $trans );
    383388                        continue;
  • tests/phpunit/tests/shortcode.php

     
    435435                                '<div [gallery]>',
    436436                        ),
    437437                        array(
     438                                '<[[gallery]]>',
     439                                '<[gallery]>',
     440                        ),
     441                        array(
     442                                '<div style="background:url([[gallery]])">',
     443                                '<div style="background:url([[gallery]])">',
     444                        ),
     445                        array(
    438446                                '[gallery]<div>Hello</div>[/gallery]',
    439447                                '',
    440448                        ),
     
    473481                                '<div [[gallery]]>',
    474482                        ),
    475483                        array(
     484                                '<[[gallery]]>',
     485                                '<[[gallery]]>',
     486                        ),
     487                        array(
    476488                                '[gallery]<div>Hello</div>[/gallery]',
    477489                                '',
    478490                        ),