From cdd007cc62a88715ca7770568455e9b44db08f3a Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 9 May 2015 23:43:07 +0000 Subject: [PATCH] Emoji: do not try to replace emoji chars inside dynamic SVGs. Fixes #32305 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@32478 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/wp-emoji.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/js/wp-emoji.js b/src/wp-includes/js/wp-emoji.js index 4331bbd562..3b1a211be0 100644 --- a/src/wp-includes/js/wp-emoji.js +++ b/src/wp-includes/js/wp-emoji.js @@ -70,11 +70,13 @@ node = node.parentNode; } - if ( ! node || ( node.className && node.className.indexOf( 'wp-exclude-emoji' ) !== -1 ) ) { + if ( ! node || node.nodeType !== 1 || ( 'ownerSVGElement' in node ) || + ( node.className && typeof node.className === 'string' && node.className.indexOf( 'wp-exclude-emoji' ) !== -1 ) ) { + continue; } - if ( node.nodeType === 1 && test( node.textContent ) ) { + if ( test( node.textContent ) ) { parse( node ); } }