Make WordPress Core

Ticket #5914: shortcode-positional-atts-r6855.patch

File shortcode-positional-atts-r6855.patch, 1005 bytes (added by tellyworth, 15 years ago)
  • wordpress/wp-includes/shortcodes.php

     
    9797
    9898function shortcode_parse_atts($text) {
    9999        $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|$)/';
    101101        if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) {
    102102                foreach ($match as $m) {
    103103                        if (!empty($m[1]))
     
    106106                                $atts[strtolower($m[3])] = stripcslashes($m[4]);
    107107                        elseif (!empty($m[5]))
    108108                                $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]);
    109113                }
    110114        }
    111115        return $atts;