Ticket #15434: wordpress_#15434.patch
File wordpress_#15434.patch, 1.5 KB (added by , 14 years ago) |
---|
-
shortcodes.php
224 224 */ 225 225 function shortcode_parse_atts($text) { 226 226 $atts = array(); 227 $pattern = '/(\w+)\s*=\s*"( [^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';227 $pattern = '/(\w+)\s*=\s*"(([^"]|\\\\")*[^\\\]{1})"(?:\s|$)|(\w+)\s*=\s*\'(([^\']|\\\')*[^\\\]{1})\'(?:\s|$)|(\w+)\s*=\s*([^\s]+)(?:\s|$)|"(([^"]|\\\\")*[^\\\]{1})"(?:\s|$)|(\S+)(?:\s|$)/'; 228 228 $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text); 229 229 if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) { 230 230 foreach ($match as $m) { 231 231 if (!empty($m[1])) 232 232 $atts[strtolower($m[1])] = stripcslashes($m[2]); 233 elseif (!empty($m[ 3]))234 $atts[strtolower($m[ 3])] = stripcslashes($m[4]);235 elseif (!empty($m[ 5]))236 $atts[strtolower($m[ 5])] = stripcslashes($m[6]);237 elseif (isset($m[ 7]) and strlen($m[7]))238 $atts[] = stripcslashes($m[ 7]);239 elseif (isset($m[ 8]))240 $atts[] = stripcslashes($m[ 8]);233 elseif (!empty($m[4])) 234 $atts[strtolower($m[4])] = stripcslashes($m[5]); 235 elseif (!empty($m[7])) 236 $atts[strtolower($m[7])] = stripcslashes($m[8]); 237 elseif (isset($m[9]) and strlen($m[9])) 238 $atts[] = stripcslashes($m[9]); 239 elseif (isset($m[11])) 240 $atts[] = stripcslashes($m[11]); 241 241 } 242 242 } else { 243 243 $atts = ltrim($text);