[wp-trac] [WordPress Trac] #35293: Emoji Regex in wp_encode_emoji() is wildly inaccurate

WordPress Trac noreply at wordpress.org
Tue Oct 3 07:11:30 UTC 2017


#35293: Emoji Regex in wp_encode_emoji() is wildly inaccurate
-------------------------------------+--------------------------
 Reporter:  pento                    |       Owner:  pento
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  4.9
Component:  Emoji                    |     Version:  4.2
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-patch needs-testing  |     Focuses:  performance
-------------------------------------+--------------------------
Changes (by pento):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"41701"]:
 {{{
 #!CommitTicketReference repository="" revision="41701"
 Emoji: Bring Twemoji compatibility to PHP.

 This was previously attempted in [41043], which unfortunately had severe
 performance issues, the regex it used was fatally slow on long posts.

 This version now uses an array of all emoji that Twemoji supports, which
 maintains the accuracy of [41043], while being the same speed or only a
 few ms slower than the code prior to [41043].

 As with [41043], the `grunt precommit:emoji` task detects when
 `twemoji.js` has changed, and regenerates the array.

 Props jmdodd for feedback, suggestions, and insults where appropriate.
 Fixes #35293. 🤞🏻
 }}}

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


More information about the wp-trac mailing list