Make WordPress Core


Ignore:
Timestamp:
12/26/2015 04:47:58 AM (9 years ago)
Author:
dd32
Message:

Shortcodes: = is a reserved character in shortcode names, mark it as such.

This allows for shortcodes such as [shortcode=attribute] to work, which while never intentionally supported were widely used in the pre-shortcode days.

Merges [36097] to the 4.4 branch, minus a string change.
Props aaroncampbell.
Fixes #34939.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4/src/wp-includes/shortcodes.php

    r35543 r36098  
    9696    }
    9797
    98     if ( 0 !== preg_match( '@[<>&/\[\]\x00-\x20]@', $tag ) ) {
     98    if ( 0 !== preg_match( '@[<>&/\[\]\x00-\x20=]@', $tag ) ) {
    9999        /* translators: %s: shortcode name */
    100100        $message = sprintf( __( 'Invalid shortcode name: %s. Do not use spaces or reserved characters: & / < > [ ]' ), $tag );
     
    211211
    212212    // Find all registered tag names in $content.
    213     preg_match_all( '@\[([^<>&/\[\]\x00-\x20]++)@', $content, $matches );
     213    preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
    214214    $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
    215215
     
    579579
    580580    // Find all registered tag names in $content.
    581     preg_match_all( '@\[([^<>&/\[\]\x00-\x20]++)@', $content, $matches );
     581    preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
    582582    $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
    583583
Note: See TracChangeset for help on using the changeset viewer.