From 2968556e670f0ed659c0a480fb58654c40b5efee Mon Sep 17 00:00:00 2001 From: Asif Iqbal Date: Sat, 28 May 2016 13:07:08 +0000 Subject: [PATCH] Remove unused codes --- src/Compilers/ShortcodeCompiler.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Compilers/ShortcodeCompiler.php b/src/Compilers/ShortcodeCompiler.php index cd341f2..0ba45b7 100644 --- a/src/Compilers/ShortcodeCompiler.php +++ b/src/Compilers/ShortcodeCompiler.php @@ -243,7 +243,7 @@ protected function parseAttributes($text) // attributes pattern $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/'; // Match - if (preg_match_all($pattern, preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text), $match, PREG_SET_ORDER)) { + if (preg_match_all($pattern, preg_replace('/[\x{00a0}\x{200b}]+/u', " ", $text), $match, PREG_SET_ORDER)) { foreach ($match as $m) { if (!empty($m[1])) { $attributes[strtolower($m[1])] = stripcslashes($m[2]); @@ -283,21 +283,11 @@ protected function getShortcodeNames() */ protected function getRegex() { - // Get shortcode names $shortcodeNames = $this->getShortcodeNames(); - // return regex return "\\[(\\[?)($shortcodeNames)(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\/\\2\\])[^\\[]*+)*+)\\[\\/\\2\\])?)(\\]?)"; } - /*private function getStripRegex() - { - // Get shortcode names - $shortcodeNames = $this->getShortcodeNames(); - - return - '\\[(\\[?)('.$shortcodeNames.')(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\/\\2\\])[^\\[]*+)*+)\\[\\/\\2\\])?)(\\]?)'; - }*/ /** * Remove all shortcode tags from the given content. *