From c77c239754f608517645e648136190d20a66498a Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 22 Apr 2008 20:54:51 +0000 Subject: [PATCH] Normalize whitespace when parsing shortcodes. Props azaozz. fixes #6562 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@7769 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/shortcodes.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index a2c7712b9..791710b18 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -115,6 +115,7 @@ function do_shortcode_tag($m, $after_formatting = false) { function shortcode_parse_atts($text) { $atts = array(); $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/'; + $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text); if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) { foreach ($match as $m) { if (!empty($m[1]))