Make WordPress Core

Ticket #32300: 32300.2.diff

File 32300.2.diff, 494 bytes (added by peterwilsoncc, 10 years ago)

validate node && node.textContent

  • src/wp-includes/js/twemoji.js

    diff --git a/src/wp-includes/js/twemoji.js b/src/wp-includes/js/twemoji.js
    index 3ff788b..fced46d4 100644
    a b var twemoji = (function ( 
    323323   * @return  Element same generic node with emoji in place, if any.
    324324   */
    325325  function parseNode(node, options) {
     326    if ( !node || !node.textContent ) {
     327      return node;
     328    }
    326329    var
    327330      allText = grabAllTextNodes(node, []),
    328331      length = allText.length,