if (!empty($m[1])) { $atts[strtolower($m[1])] = stripcslashes($m[2]); } elseif (!empty($m[3])) { $atts[strtolower($m[3])] = stripcslashes($m[4]); } elseif (!empty($m[5])) { $atts[strtolower($m[5])] = stripcslashes($m[6]); } elseif (isset($m[7]) and strlen($m[7])) { $atts[] = stripcslashes($m[7]); } elseif (isset($m[8])) { $atts[] = stripcslashes($m[8]); } } } else { $atts = ltrim($text); } return $atts; } /** * */ private static function getRegex() { $tagnames = array_keys(self::$tags); $tagregexp = implode("|", array_map("preg_quote", $tagnames)); return '\\[' . '(\\[?)' . "({$tagregexp})" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] } } // initialize the shortcoder Bbpp_ThankMeLater_Shortcoder::init();