Ticket #5914: shortcode-positional-atts-r6855.patch
File shortcode-positional-atts-r6855.patch, 1005 bytes (added by , 15 years ago) |
---|
-
wordpress/wp-includes/shortcodes.php
97 97 98 98 function shortcode_parse_atts($text) { 99 99 $atts = array(); 100 $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$) /';100 $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/'; 101 101 if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) { 102 102 foreach ($match as $m) { 103 103 if (!empty($m[1])) … … 106 106 $atts[strtolower($m[3])] = stripcslashes($m[4]); 107 107 elseif (!empty($m[5])) 108 108 $atts[strtolower($m[5])] = stripcslashes($m[6]); 109 elseif (isset($m[7]) and strlen($m[7])) 110 $atts[] = stripcslashes($m[7]); 111 elseif (isset($m[8])) 112 $atts[] = stripcslashes($m[8]); 109 113 } 110 114 } 111 115 return $atts;