[wp-trac] [WordPress Trac] #32300: twemoji.js - validate data before passing to twemoji.parse

WordPress Trac noreply at wordpress.org
Sun May 10 04:54:59 UTC 2015


#32300: twemoji.js - validate data before passing to twemoji.parse
---------------------------+-------------------------
 Reporter:  peterwilsoncc  |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  4.3
Component:  Formatting     |     Version:  4.2
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  javascript
---------------------------+-------------------------

Comment (by peterwilsoncc):

 Thanks Andrew, really vauge moment and forgot that within seconds of
 talking about it :/

 Just noticed trac cuts off emoji and beyond in the unit tests, in full
 from comment:1

 {{{#!js
 wp.emoji.parse( null );
 wp.emoji.parse();
 wp.emoji.parse( {} );
 wp.emoji.parse( [] );
 wp.emoji.parse( "" );
 wp.emoji.parse( "\uD83D\uDC3C\uD83C\uDDE8\uD83C\uDDF3" ); //panda, china
 wp.emoji.parse( document.body );
 wp.emoji.parse( function(){} );
 wp.emoji.parse( document.createElement( 'p' ).appendChild(
 document.createElement( 'strong') ) );
 wp.emoji.parse( document.createElement( 'svg' ).appendChild(
 document.createElement( 'path' ) ) );
 wp.emoji.parse( window );
 }}}

 The aim is to just chuck everything at it ensure it passes.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32300#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list