WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/23/2015 12:07:47 PM (5 years ago)
Author:
pento
Message:

Emoji: Gmail doesn't obey an <img>'s inline CSS height rule, transforming it to min-height. To avoid giant smiley faces everywhere, we're changing the height rule to max-height, which Gmail plays nicer with.

Props janhenckens.

Fixes #31719.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r31861 r31864  
    21102110    $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
    21112111
    2112     return sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em;" />', esc_url( $src_url ), esc_attr( $smiley ) );
     2112    return sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="max-height: 1em;" />', esc_url( $src_url ), esc_attr( $smiley ) );
    21132113}
    21142114
     
    42014201
    42024202                        list( $char1, $char2 ) = str_split( $chars, 5 );
    4203                         $entity = '<img src="' . $cdn_url . $char1 . '-' . $char2 . $ext . '" class="wp-smiley" style="height: 1em;" />';
     4203                        $entity = '<img src="' . $cdn_url . $char1 . '-' . $char2 . $ext . '" class="wp-smiley" style="max-height: 1em;" />';
    42044204
    42054205                        $content = str_replace( $flag, $entity, $content );
     
    42164216                    foreach ( $matches[1] as $emoji ) {
    42174217                        $char = str_replace( array( '&#x', ';'), '', $emoji );
    4218                         $entity = '<img src="' . $cdn_url . $char . $ext . '" class="wp-smiley" style="height: 1em;" />';
     4218                        $entity = '<img src="' . $cdn_url . $char . $ext . '" class="wp-smiley" style="max-height: 1em;" />';
    42194219
    42204220                        $content = str_replace( $emoji, $entity, $content );
Note: See TracChangeset for help on using the changeset viewer.