Make WordPress Core

Ticket #31242: 31242.12.patch

File 31242.12.patch, 2.4 KB (added by azaozz, 10 years ago)
  • src/wp-includes/js/twemoji.js

     
    370370          }
    371371        }
    372372        fragment.appendChild(img || createText(alt));
    373         img = null;
    374373      }
    375374      // is there actually anything to replace in here ?
    376       if (0 < i) {
     375      if (img) {
     376        img = null;
    377377        // any text left to be added ?
    378378        if (i < text.length) {
    379379          fragment.appendChild(
     
    516516    return r.join(sep || '-');
    517517  }
    518518
    519 }());
    520  No newline at end of file
     519}());
  • src/wp-includes/js/wp-emoji.js

     
    11window.wp = window.wp || {};
    22
    33( function( window, wp, twemoji, settings ) {
     4        var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
     5
    46        var emoji = {
    57                /**
    68                 * Flag to determine if we should parse all emoji characters into Twemoji images.
     
    6870                                                                node = node.parentNode;
    6971                                                        }
    7072
    71                                                         if ( node.nodeType === 1 ) {
     73                                                        if ( node && node.nodeType === 1 ) {
    7274                                                                emoji.parse( node );
    7375                                                        }
    7476                                                }
     
    9597                        var canvas = document.createElement( 'canvas' ),
    9698                                context = canvas.getContext && canvas.getContext( '2d' );
    9799
    98                         if ( ! context.fillText ) {
     100                        if ( ! context || ! context.fillText ) {
    99101                                return false;
    100102                        }
    101103
     
    123125                        var canvas = document.createElement( 'canvas' ),
    124126                                context = canvas.getContext && canvas.getContext( '2d' );
    125127
    126                         if ( ! context.fillText ) {
     128                        if ( ! context || ! context.fillText ) {
    127129                                return false;
    128130                        }
    129131
  • src/wp-includes/script-loader.php

     
    434434                 *
    435435                 * @param string The emoji base URL.
    436436                 */
    437                 'baseUrl' => apply_filters( 'emoji_url', '//s0.wp.com/wp-content/mu-plugins/emoji/twemoji/72x72/' ),
     437                'baseUrl' => apply_filters( 'emoji_url', '//s0.wp.com/wp-content/mu-plugins/emoji/twemoji/72x72' ),
    438438                /**
    439439                 * Filter the extension of the emoji files.
    440440                 *