Index: src/wp-includes/formatting.php
===================================================================
--- src/wp-includes/formatting.php (revision 28831)
+++ src/wp-includes/formatting.php (working copy)
@@ -198,7 +198,7 @@
. '(?(?=!--)' // Is this a comment?
. '.+?--\s*>' // Find end of comment
. '|'
- . '.+?>' // Find end of element
+ . '[^>]+>' // Find end of element
. ')'
. '|'
. '\[' // Find start of shortcode.
@@ -206,7 +206,7 @@
. '(?:'
. '[^\[\]<>]' // Shortcodes do not contain other shortcodes.
. '|'
- . '<.+?>' // HTML elements permitted. Prevents matching ] before >.
+ . '<[^>]+>' // HTML elements permitted. Prevents matching ] before >.
. ')+'
. '\]' // Find end of shortcode.
. '\]?' // Shortcodes may end with ]]
Index: tests/phpunit/tests/formatting/WPTexturize.php
===================================================================
--- tests/phpunit/tests/formatting/WPTexturize.php (revision 28831)
+++ tests/phpunit/tests/formatting/WPTexturize.php (working copy)
@@ -1305,6 +1305,22 @@
'word word', // Ensure we are not corrupting image URLs.
'word word',
),
+ array(
+ '[ do texturize "[quote]" here ]',
+ '[ do texturize “[quote]” here ]',
+ ),
+ array(
+ '[ regex catches this here ]',
+ '[ regex catches this here ]',
+ ),
+ array(
+ '[ but also catches the styled "[quote]" here ]',
+ '[ but also catches the styled “[quote]” here ]',
+ ),
+ array(
+ '[Let\'s get crazy[plugin code="hello"]world]',
+ '[Let’s get crazy[plugin code="hello"]world]',
+ ),
);
}