[wp-trac] [WordPress Trac] #41501: Emoji: Short-circuit wp_staticize_emoji() when there are no emoji to staticise.

WordPress Trac noreply at wordpress.org
Tue Aug 1 07:03:34 UTC 2017


#41501: Emoji: Short-circuit wp_staticize_emoji() when there are no emoji to
staticise.
-------------------------------------+--------------------------
 Reporter:  pento                    |       Owner:  pento
     Type:  defect (bug)             |      Status:  assigned
 Priority:  high                     |   Milestone:  4.8.1
Component:  Emoji                    |     Version:  trunk
 Severity:  major                    |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  performance
-------------------------------------+--------------------------

Comment (by pento):

 Thank you for the additional patch, @umangvaghela123!

 Unfortunately, [attachment:41501.patch] doesn't quite do the right thing -
 I've created [attachment:41501.2.diff], to show a little clearer what's
 going on.

 It can return early, if the following conditions are met:

 - It only contains ASCII. This is tested by `mb_check_encoding()`, if
 available, or the `preg_match()`, if it isn't.
 - AND, it doesn't contain the string '&#x', which possibly indicates a
 HTML encoded entity that we need to test further.

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


More information about the wp-trac mailing list