Allow shortcode parameter names (attributes) to contain dashes.

Props aaroncampbell, tyxla, izem
Fixes #9405

Built from https://develop.svn.wordpress.org/trunk@33118


git-svn-id: http://core.svn.wordpress.org/trunk@33089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2015-07-07 23:59:24 +00:00
parent 9c3bc85649
commit bc745f81a9
2 changed files with 2 additions and 2 deletions

View File

@ -309,7 +309,7 @@ function do_shortcode_tag( $m ) {
*/ */
function shortcode_parse_atts($text) { function shortcode_parse_atts($text) {
$atts = array(); $atts = array();
$pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/'; $pattern = '/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*\'([^\']*)\'(?:\s|$)|([\w-]+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';
$text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text); $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) { if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) {
foreach ($match as $m) { foreach ($match as $m) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-beta1-33117'; $wp_version = '4.3-beta1-33118';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.