[wp-trac] [WordPress Trac] #33787: Euro hex code being converted to smiley url

WordPress Trac noreply at wordpress.org
Thu Sep 10 19:53:39 UTC 2015


#33787: Euro hex code being converted to smiley url
----------------------------------------+-----------------------------
 Reporter:  UmeshSingla                 |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Formatting                  |     Version:  4.2
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+-----------------------------

Comment (by azaozz):

 > Ideally, we should be using the same regex as in twemoji.js

 You mean this one: https://github.com/twitter/twemoji/blob/gh-
 pages/twemoji.js#L236? It is generated from
 http://www.unicode.org/Public/UNIDATA/EmojiSources.txt. We are matching
 (hex) HTML entities as strings, can probably just get the first column (as
 array), and do something like:
 {{{
 '/&#x(' . array_join( '|', $codepoints ) . ');/i';
 }}}

 However that will generate pretty long regexp. Not sure if PCRE (all the
 versions used in different PHP versions) is optimized to handle it. We had
 problems with that in Chrome which were fixed by optimizing the actual
 regexp (by the browser) before running it.

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


More information about the wp-trac mailing list