diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index a76a4927b7..334806b9e0 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -3230,7 +3230,7 @@ function convert_smilies( $text ) { $content = $textarr[ $i ]; // If we're in an ignore block, wait until we find its closing tag - if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) { + if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')[^>]*>/', $content, $matches ) ) { $ignore_block_element = $matches[1]; } diff --git a/tests/phpunit/tests/formatting/Smilies.php b/tests/phpunit/tests/formatting/Smilies.php index d1fd3af1a5..662de0b4f6 100644 --- a/tests/phpunit/tests/formatting/Smilies.php +++ b/tests/phpunit/tests/formatting/Smilies.php @@ -146,8 +146,8 @@ class Tests_Formatting_Smilies extends WP_UnitTestCase { public function test_ignore_smilies_in_tags( $element ) { $includes_path = includes_url( 'images/smilies/' ); - $in_str = 'Do we ingore smilies ;-) in ' . $element . ' tags <' . $element . '>My Content Here :?: '; - $exp_str = "Do we ingore smilies \xf0\x9f\x98\x89 in $element tags <$element>My Content Here :?: "; + $in_str = 'Do we ingore smilies ;-) in ' . $element . ' tags <' . $element . ' class="foo">My Content Here :?: '; + $exp_str = "Do we ingore smilies \xf0\x9f\x98\x89 in $element tags <$element class=\"foo\">My Content Here :?: "; // standard smilies, use_smilies: ON update_option( 'use_smilies', 1 );