Changeset 41045
- Timestamp:
- 07/14/2017 11:49:34 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r41043 r41045 5291 5291 if ( 'codepoints' === $type && ( ! defined( 'PCRE_VERSION' ) || version_compare( PCRE_VERSION, '8.32', '<=' ) ) ) { 5292 5292 return '/( 5293 \xE2\x98[\x80-\xFF] # Symbols 5294 | \xE2\x99[\x00-\xFF] 5295 | [\xE3-\xED][\x00-\xFF]{2} 5293 \xE2\x99[\x80-\x82] # Male and female symbols 5296 5294 | [\x23\x30-\x39]\xE2\x83\xA3 # Digits 5297 5295 | \xF0\x9F[\x85-\x88][\xA6-\xBF] # Enclosed characters -
trunk/tests/phpunit/tests/formatting/Emoji.php
r41043 r41045 102 102 '🧚', 103 103 ), 104 105 104 ); 106 105 } … … 115 114 116 115 public function data_wp_staticize_emoji() { 117 returnarray(116 $data = array( 118 117 array( 119 118 // Not emoji … … 124 123 // Simple emoji 125 124 '🙂', 126 '<img src="' . $this->png_cdn . '1f642.png" alt=" 🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />',125 '<img src="' . $this->png_cdn . '1f642.png" alt="" class="wp-smiley" style="height: 1em; max-height: 1em;" />', 127 126 ), 128 127 array( 129 128 // Skin tone, gender, ZWJ, emoji selector 130 129 '👮🏼♀️', 131 '<img src="' . $this->png_cdn . '1f46e-1f3fc-200d-2640-fe0f.png" alt=" 👮🏼♀️" class="wp-smiley" style="height: 1em; max-height: 1em;" />',130 '<img src="' . $this->png_cdn . '1f46e-1f3fc-200d-2640-fe0f.png" alt="" class="wp-smiley" style="height: 1em; max-height: 1em;" />', 132 131 ), 133 132 array( 134 133 // Unicode 10 135 134 '🧚', 136 '<img src="' . $this->png_cdn . '1f9da.png" alt=" 🧚" class="wp-smiley" style="height: 1em; max-height: 1em;" />',135 '<img src="' . $this->png_cdn . '1f9da.png" alt="" class="wp-smiley" style="height: 1em; max-height: 1em;" />', 137 136 ), 137 ); 138 138 139 ); 139 // Older versions of PHP don't html_entity_decode() emoji, so we need to make sure they're testing in the expected form. 140 foreach ( $data as $key => $datum ) { 141 $emoji = html_entity_decode( wp_encode_emoji( $datum[0] ) ); 142 $data[ $key ][1] = str_replace( 'alt=""', 'alt="' . $emoji . '"', $datum[1] ); 143 } 144 145 return $data; 140 146 } 141 147
Note: See TracChangeset
for help on using the changeset viewer.