Make WordPress Core

Ticket #34090: 34090.diff

File 34090.diff, 553 bytes (added by miqrogroove, 9 years ago)
  • src/wp-includes/shortcodes.php

     
    8888 */
    8989function add_shortcode($tag, $func) {
    9090        global $shortcode_tags;
     91       
     92        if ( '' == $tag || 0 !== preg_match( '@[<>&/\[\]\x00-\x20]@', $tag ) ) {
     93                _doing_it_wrong( __FUNCTION__, __( 'Invalid shortcode name. Do not use reserved chars: & / < > [ ]' ), '4.4' );
     94                return;
     95        }
     96       
    9197        $shortcode_tags[ $tag ] = $func;
    9298}
    9399