Make WordPress Core

Ticket #33116: 33116.trunk.2.patch

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

     
    359359
    360360                $attributes = wp_kses_attr_parse( $element );
    361361                if ( false === $attributes ) {
     362                        // Some plugins are doing things like [name] <[email]>.
     363                        if ( 1 === preg_match( '%^<\s*\[\[?[^\[\]]+\]%', $element ) ) {
     364                                _doing_it_wrong( 'do_shortcode', 'Shortcodes in unnamed elements are no longer supported. This feature will be removed in 4.4.', '4.3' );
     365                                $element = preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $element );
     366                        }
     367
    362368                        // Looks like we found some crazy unfiltered HTML.  Skipping it for sanity.
    363369                        $element = strtr( $element, $trans );
    364370                        continue;
  • tests/phpunit/tests/shortcode.php

     
    435435                                '<div [gallery]>',
    436436                        ),
    437437                        array(
     438                                '<div style="background:url([[gallery]])">',
     439                                '<div style="background:url([[gallery]])">',
     440                        ),
     441                        array(
    438442                                '[gallery]<div>Hello</div>[/gallery]',
    439443                                '',
    440444                        ),
     
    473477                                '<div [[gallery]]>',
    474478                        ),
    475479                        array(
     480                                '<[[gallery]]>',
     481                                '<[[gallery]]>',
     482                        ),
     483                        array(
    476484                                '[gallery]<div>Hello</div>[/gallery]',
    477485                                '',
    478486                        ),