WordPress.org

Make WordPress Core

Ticket #9264: shortcodes.diff

File shortcodes.diff, 619 bytes (added by rb-cohen, 5 years ago)

Patch for wp-includes/shortcodes.php

  • wp-includes/shortcodes.php

     
    175175        $tagnames = array_keys($shortcode_tags); 
    176176        $tagregexp = join( '|', array_map('preg_quote', $tagnames) ); 
    177177 
    178         return '(.?)\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)'; 
     178        return '(.?)\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?(4)|(?:(.+?)\[\/\2\]))?(.?)'; 
    179179} 
    180180 
    181181/** 
     
    294294 
    295295add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop() 
    296296 
    297 ?> 
    298  No newline at end of file 
     297?>