Normalize whitespace when parsing shortcodes. Props azaozz. fixes #6562 for trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@7769 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-04-22 20:54:51 +00:00
parent 8e241a203a
commit 5837ef3998

View File

@ -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]))