From d2a64fdabdd3bec1341bb22dc6a3b01797360ce8 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Thu, 27 Jun 2019 02:05:52 +0000 Subject: [PATCH] Formatting: Don't convert smilies in ignored tags that have attributes. Smilies in ignored tags are not supposed to be converted to emoji, but this can malfunction if the tag has attributes. For example, the Preformatted block with add a `class` to the `
` tag.

Props pento, jikamens.
Fixes #47489.


Built from https://develop.svn.wordpress.org/trunk@45569


git-svn-id: http://core.svn.wordpress.org/trunk@45380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
 wp-includes/formatting.php | 2 +-
 wp-includes/version.php    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 93a05eac6f..4d36452c90 100644
--- a/wp-includes/formatting.php
+++ b/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/wp-includes/version.php b/wp-includes/version.php
index 2537489529..216396ca86 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '5.3-alpha-45568';
+$wp_version = '5.3-alpha-45569';
 
 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.