Make WordPress Core

Ticket #33116: 33116.branch.patch

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

     
    373373
    374374                $attributes = wp_kses_attr_parse( $element );
    375375                if ( false === $attributes ) {
     376                        // Some plugins are doing weird things like [name] <[email]>.
     377                        if ( 1 === preg_match( '%^<\s*\[\[?[^\[\]]+\]%', $element ) ) {
     378                                $element = preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $element );
     379                        }
     380
    376381                        // Looks like we found some crazy unfiltered HTML.  Skipping it for sanity.
    377382                        $element = strtr( $element, $trans );
    378383                        continue;
  • tests/phpunit/tests/shortcode.php

     
    417417                                '<div [gallery]>',
    418418                        ),
    419419                        array(
     420                                '<[[gallery]]>',
     421                                '<[gallery]>',
     422                        ),
     423                        array(
     424                                '<div style="background:url([[gallery]])">',
     425                                '<div style="background:url([[gallery]])">',
     426                        ),
     427                        array(
    420428                                '[gallery]<div>Hello</div>[/gallery]',
    421429                                '',
    422430                        ),
     
    455463                                '<div [[gallery]]>',
    456464                        ),
    457465                        array(
     466                                '<[[gallery]]>',
     467                                '<[[gallery]]>',
     468                        ),
     469                        array(
    458470                                '[gallery]<div>Hello</div>[/gallery]',
    459471                                '',
    460472                        ),