[wp-trac] [WordPress Trac] #32995: Flag Emoji in emails substituted by img HTML tag, alt attribute is erroneously substituted

WordPress Trac noreply at wordpress.org
Tue Jul 14 14:47:46 UTC 2015


#32995: Flag Emoji in emails substituted by img HTML tag, alt attribute is
erroneously substituted
--------------------------+-----------------------------
 Reporter:  cesargml      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Formatting    |    Version:  4.2.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Using Wordpress with WooCommerce (2.3.13), I have some products with
 titles that contain flag emojis. The flag emojis display correctly on the
 frontend and backend. But I noticed that on the order confirmation emails,
 there was an error with the creation of the HTML version (see attached
 image).

 I tracked the generation of this HTML to wp-includes/formatting.php line
 4278, part of the function wp_staticize_emoji(). This function substitues
 emojis with imgs for RSS and emails. On those lines The ALT attribute of
 the generated IMG tag is set to html_entity_decode($flag) where flag is
 the flag emoji (in my case 🇪🇸).

 The wrongly generated HTML is in this case, with GMail as email client:

 {{{
 <img src="https://ci6.googleusercontent.com/proxy/ri25l2bmLkJ0tNLqPXbY8C-
 I9nCBGWOOGBCGysveg6e7QYb_mnqFw8da89OS1k4k7RWGWjx142nfLxLDBxoGdCrqUuM5nj1-3_F2zA=s0-d-e1-ft#http://s.w.org/images/core/emoji/72x72
 /1f1ea-1f1f8.png" alt="<img src=" style="min-height:1em;max-height:1em"
 class="CToWUd"><img src="https://ci6.googleusercontent.com/proxy/4YCB-
 609xwpaVaGeE7Jur5ePhECuKkxG0ADWLB8pyF7gAf9-M9m740c5stRdsgylSLOWQVp1UM-
 O6KPsfjJYIgOLsLBEaw=s0-d-e1-ft#http://s.w.org/images/core/emoji/72x72/1f1f8.png"
 alt="🇸" style="min-height:1em;max-height:1em" class="CToWUd">" class="wp-
 smiley" style="height: 1em; max-height: 1em;" />
 }}}

 As a preliminary fix I replaced the html_entity_decode() call with a
 string "flag". Doing this the generated email displays the flag correctly.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32995>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list