Changeset 31733
- Timestamp:
- 03/11/2015 10:48:16 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-editor.php
r31718 r31733 361 361 'wpautoresize', 362 362 'wpeditimage', 363 'wpemoji', 363 364 'wpgallery', 364 365 'wplink', -
trunk/src/wp-includes/default-filters.php
r31726 r31733 161 161 add_filter( 'the_title_rss', 'esc_html' ); 162 162 add_filter( 'the_content_rss', 'ent2ncr', 8 ); 163 add_filter( 'the_content_feed', 'feed_emoji' ); 163 164 add_filter( 'the_excerpt_rss', 'convert_chars' ); 164 165 add_filter( 'the_excerpt_rss', 'ent2ncr', 8 ); … … 166 167 add_filter( 'comment_text_rss', 'ent2ncr', 8 ); 167 168 add_filter( 'comment_text_rss', 'esc_html' ); 169 add_filter( 'comment_text_rss', 'feed_emoji' ); 168 170 add_filter( 'bloginfo_rss', 'ent2ncr', 8 ); 169 171 add_filter( 'the_author', 'ent2ncr', 8 ); 170 172 add_filter( 'the_guid', 'esc_url' ); 173 174 // Email filters 175 add_filter( 'wp_mail', 'mail_emoji' ); 171 176 172 177 // Misc filters … … 219 224 add_action( 'init', 'check_theme_switched', 99 ); 220 225 add_action( 'after_switch_theme', '_wp_sidebars_changed' ); 226 add_action( 'wp_print_styles', 'print_emoji_styles' ); 221 227 222 228 if ( isset( $_GET['replytocom'] ) ) … … 249 255 add_action( 'admin_print_footer_scripts', '_wp_footer_scripts' ); 250 256 add_action( 'admin_print_styles', 'print_admin_styles', 20 ); 257 add_action( 'admin_print_styles', 'print_emoji_styles' ); 251 258 add_action( 'init', 'smilies_init', 5 ); 252 259 add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); -
trunk/src/wp-includes/feed.php
r30681 r31733 650 650 return $feed; 651 651 } 652 653 /** 654 * Convert emoji characters in a feed into static images. 655 * 656 * @param string $content The content to convert. 657 * 658 * @return The converted content. 659 */ 660 function feed_emoji( $content ) { 661 return wp_staticize_emoji( $content, true ); 662 } -
trunk/src/wp-includes/formatting.php
r31678 r31733 2038 2038 $smiley = trim( reset( $matches ) ); 2039 2039 $img = $wpsmiliestrans[ $smiley ]; 2040 2041 $matches = array(); 2042 $ext = preg_match( '/\.([^.]+)$/', $img, $matches ) ? strtolower( $matches[1] ) : false; 2043 $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ); 2044 2045 // Don't convert smilies that aren't images - they're probably emoji. 2046 if ( ! in_array( $ext, $image_exts ) ) { 2047 return $img; 2048 } 2040 2049 2041 2050 /** … … 4016 4025 return $spaces; 4017 4026 } 4027 4028 /** 4029 * Print the important emoji-related styles. 4030 * 4031 * @since 4.2.0 4032 */ 4033 function print_emoji_styles() { 4034 ?> 4035 <style type="text/css"> 4036 img.wp-smiley, 4037 img.emoji { 4038 border: none !important; 4039 box-shadow: none !important; 4040 height: 1em !important; 4041 width: 1em !important; 4042 margin: 0 .05em 0 .1em !important; 4043 vertical-align: -0.1em !important; 4044 background: none !important; 4045 padding: 0 !important; 4046 } 4047 </style> 4048 <?php 4049 } 4050 4051 /** 4052 * Convert any 4 byte emoji in a string to their equivalent HTML entity. 4053 * Currently, only Unicode 7 emoji are supported. Unicode 8 emoji will be added 4054 * when the spec in finalised, along with the new skin-tone modifiers. 4055 * 4056 * This allows us to store emoji in a DB using the utf8 character set. 4057 * 4058 * @since 4.2.0 4059 * 4060 * @param string $content The content to encode. 4061 * @return string The encoded content. 4062 */ 4063 function wp_encode_emoji( $content ) { 4064 if ( function_exists( 'mb_convert_encoding' ) ) { 4065 $regex = '/( 4066 \x23\xE2\x83\xA3 # Digits 4067 [\x30-\x39]\xE2\x83\xA3 4068 | \xF0\x9F[\x85-\x88][\xA6-\xBF] # Enclosed characters 4069 | \xF0\x9F[\x8C-\x97][\x80-\xBF] # Misc 4070 | \xF0\x9F\x98[\x80-\xBF] # Smilies 4071 | \xF0\x9F\x99[\x80-\x8F] 4072 | \xF0\x9F\x9A[\x80-\xBF] # Transport and map symbols 4073 | \xF0\x9F\x99[\x80-\x85] 4074 )/x'; 4075 4076 $matches = array(); 4077 if ( preg_match_all( $regex, $content, $matches ) ) { 4078 if ( ! empty( $matches[1] ) ) { 4079 foreach( $matches[1] as $emoji ) { 4080 /* 4081 * UTF-32's hex encoding is the same as HTML's hex encoding. 4082 * So, by converting the emoji from UTF-8 to UTF-32, we magically 4083 * get the correct hex encoding. 4084 */ 4085 $unpacked = unpack( 'H*', mb_convert_encoding( $emoji, 'UTF-32', 'UTF-8' ) ); 4086 if ( isset( $unpacked[1] ) ) { 4087 $entity = '&#x' . trim( $unpacked[1], '0' ) . ';'; 4088 $content = str_replace( $emoji, $entity, $content ); 4089 } 4090 } 4091 } 4092 } 4093 } 4094 4095 return $content; 4096 } 4097 4098 /** 4099 * Convert emoji to a static <img> link. 4100 * 4101 * @since 4.2.0 4102 * 4103 * @param string $content The content to encode. 4104 * @return string The encoded content. 4105 */ 4106 function wp_staticize_emoji( $content ) { 4107 $content = wp_encode_emoji( $content ); 4108 4109 if ( ! class_exists( 'DOMDocument' ) ) { 4110 return $content; 4111 } 4112 4113 /** This filter is documented in wp-includes/script-loader.php */ 4114 $cdn_url = apply_filters( 'emoji_url', '//s0.wp.com/wp-content/mu-plugins/emoji/twemoji/72x72/' ); 4115 /** This filter is documented in wp-includes/script-loader.php */ 4116 $ext = apply_filters( 'emoji_ext', '.png' ); 4117 4118 $html = '<!DOCTYPE html><html><head></head><body>' . $content . '</body></html>'; 4119 4120 $document = new DOMDocument; 4121 if ( ! $document->loadHTML( $html ) ) { 4122 return $content; 4123 } 4124 4125 $xpath = new DOMXPath( $document ); 4126 $textnodes = $xpath->query( '//text()' ); 4127 4128 foreach( $textnodes as $node ) { 4129 $originalText = $text = wp_encode_emoji( $node->nodeValue ); 4130 4131 $matches = array(); 4132 if ( preg_match_all( '/(DZ(e[6-9a-f]|f[0-9a-f]);){2}/', $text, $matches ) ) { 4133 if ( ! empty( $matches[0] ) ) { 4134 foreach ( $matches[0] as $flag ) { 4135 $chars = str_replace( array( '&#x', ';'), '', $flag ); 4136 4137 list( $char1, $char2 ) = str_split( $chars, 5 ); 4138 $entity = '<img src="https:' . $cdn_url . $char1 . '-' . $char2 . $ext . '" class="wp-smiley" style="height: 1em;" />'; 4139 4140 $text = str_replace( $flag, $entity, $text ); 4141 } 4142 } 4143 } 4144 4145 // Loosely match the Emoji Unicode range. 4146 $regex = '/(&#x[2-3][0-9a-f]{3};|[1-6][0-9a-f]{2};)/'; 4147 4148 $matches = array(); 4149 if ( preg_match_all( $regex, $text, $matches ) ) { 4150 if ( ! empty( $matches[1] ) ) { 4151 foreach ( $matches[1] as $emoji ) { 4152 $char = str_replace( array( '&#x', ';'), '', $emoji ); 4153 $entity = '<img src="https:' . $cdn_url . $char . $ext . '" class="wp-smiley" style="height: 1em;" />'; 4154 4155 $text = str_replace( $emoji, $entity, $text ); 4156 } 4157 } 4158 } 4159 4160 if ( $originalText !== $text ) { 4161 $content = str_replace( $originalText, $text, $content ); 4162 } 4163 } 4164 4165 return $content; 4166 } 4167 4168 /** 4169 * Convert emoji in emails into static images. 4170 * 4171 * @param array $mail The email data array. 4172 * 4173 * @return array The email data array, with emoji in the message staticized. 4174 */ 4175 function mail_emoji( $mail ) { 4176 $mail['message'] = wp_staticize_emoji( $mail['message'], true ); 4177 return $mail; 4178 } -
trunk/src/wp-includes/functions.php
r31590 r31733 2946 2946 if ( !isset( $wpsmiliestrans ) ) { 2947 2947 $wpsmiliestrans = array( 2948 ':mrgreen:' => ' icon_mrgreen.gif',2949 ':neutral:' => 'icon_neutral.gif',2950 ':twisted:' => 'icon_twisted.gif',2951 ':arrow:' => 'icon_arrow.gif',2952 ':shock:' => 'icon_eek.gif',2953 ':smile:' => ' icon_smile.gif',2954 ':???:' => 'icon_confused.gif',2955 ':cool:' => 'icon_cool.gif',2956 ':evil:' => 'icon_evil.gif',2957 ':grin:' => 'icon_biggrin.gif',2958 ':idea:' => 'icon_idea.gif',2959 ':oops:' => 'icon_redface.gif',2960 ':razz:' => 'icon_razz.gif',2961 ':roll:' => ' icon_rolleyes.gif',2962 ':wink:' => 'icon_wink.gif',2963 ':cry:' => 'icon_cry.gif',2964 ':eek:' => 'icon_surprised.gif',2965 ':lol:' => 'icon_lol.gif',2966 ':mad:' => 'icon_mad.gif',2967 ':sad:' => 'icon_sad.gif',2968 '8-)' => 'icon_cool.gif',2969 '8-O' => 'icon_eek.gif',2970 ':-(' => 'icon_sad.gif',2971 ':-)' => ' icon_smile.gif',2972 ':-?' => 'icon_confused.gif',2973 ':-D' => 'icon_biggrin.gif',2974 ':-P' => 'icon_razz.gif',2975 ':-o' => 'icon_surprised.gif',2976 ':-x' => 'icon_mad.gif',2977 ':-|' => 'icon_neutral.gif',2978 ';-)' => 'icon_wink.gif',2948 ':mrgreen:' => 'mrgreen.png', 2949 ':neutral:' => "\xf0\x9f\x98\x90", 2950 ':twisted:' => "\xf0\x9f\x98\x88", 2951 ':arrow:' => "\xe2\x9e\xa1", 2952 ':shock:' => "\xf0\x9f\x98\xaf", 2953 ':smile:' => 'simple-smile.png', 2954 ':???:' => "\xf0\x9f\x98\xaf", 2955 ':cool:' => "\xf0\x9f\x98\x8e", 2956 ':evil:' => "\xf0\x9f\x91\xbf", 2957 ':grin:' => "\xf0\x9f\x98\x84", 2958 ':idea:' => "\xf0\x9f\x92\xa1", 2959 ':oops:' => "\xf0\x9f\x98\xb3", 2960 ':razz:' => "\xf0\x9f\x98\x9b", 2961 ':roll:' => 'rolleyes.png', 2962 ':wink:' => "\xf0\x9f\x98\x89", 2963 ':cry:' => "\xf0\x9f\x98\xa5", 2964 ':eek:' => "\xf0\x9f\x98\xaf", 2965 ':lol:' => "\xf0\x9f\x98\x84", 2966 ':mad:' => "\xf0\x9f\x98\xa1", 2967 ':sad:' => "\xf0\x9f\x98\xa6", 2968 '8-)' => "\xf0\x9f\x98\x8e", 2969 '8-O' => "\xf0\x9f\x98\xaf", 2970 ':-(' => "\xf0\x9f\x98\xa6", 2971 ':-)' => 'simple-smile.png', 2972 ':-?' => "\xf0\x9f\x98\xaf", 2973 ':-D' => "\xf0\x9f\x98\x84", 2974 ':-P' => "\xf0\x9f\x98\x9b", 2975 ':-o' => "\xf0\x9f\x98\xaf", 2976 ':-x' => "\xf0\x9f\x98\xa1", 2977 ':-|' => "\xf0\x9f\x98\x90", 2978 ';-)' => "\xf0\x9f\x98\x89", 2979 2979 // This one transformation breaks regular text with frequency. 2980 // '8)' => 'icon_cool.gif',2981 '8O' => 'icon_eek.gif',2982 ':(' => 'icon_sad.gif',2983 ':)' => ' icon_smile.gif',2984 ':?' => 'icon_confused.gif',2985 ':D' => 'icon_biggrin.gif',2986 ':P' => 'icon_razz.gif',2987 ':o' => 'icon_surprised.gif',2988 ':x' => 'icon_mad.gif',2989 ':|' => 'icon_neutral.gif',2990 ';)' => 'icon_wink.gif',2991 ':!:' => 'icon_exclaim.gif',2992 ':?:' => 'icon_question.gif',2980 // '8)' => "\xf0\x9f\x98\x8e", 2981 '8O' => "\xf0\x9f\x98\xaf", 2982 ':(' => "\xf0\x9f\x98\xa6", 2983 ':)' => 'simple-smile.png', 2984 ':?' => "\xf0\x9f\x98\xaf", 2985 ':D' => "\xf0\x9f\x98\x84", 2986 ':P' => "\xf0\x9f\x98\x9b", 2987 ':o' => "\xf0\x9f\x98\xaf", 2988 ':x' => "\xf0\x9f\x98\xa1", 2989 ':|' => "\xf0\x9f\x98\x90", 2990 ';)' => "\xf0\x9f\x98\x89", 2991 ':!:' => "\xe2\x9d\x97", 2992 ':?:' => "\xe2\x9d\x93", 2993 2993 ); 2994 2994 } -
trunk/src/wp-includes/post.php
r31660 r31733 3330 3330 $data = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'post_mime_type', 'guid' ); 3331 3331 3332 $emoji_fields = array( 'post_title', 'post_content', 'post_excerpt' ); 3333 3334 foreach( $emoji_fields as $emoji_field ) { 3335 if ( isset( $data[ $emoji_field ] ) ) { 3336 $charset = $wpdb->get_col_charset( $wpdb->posts, $emoji_field ); 3337 if ( 'utf8' === $charset ) { 3338 $data[ $emoji_field ] = wp_encode_emoji( $data[ $emoji_field ] ); 3339 } 3340 } 3341 } 3342 3332 3343 if ( 'attachment' === $post_type ) { 3333 3344 /** -
trunk/src/wp-includes/script-loader.php
r31723 r31733 425 425 $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models', 'media-audiovideo', 'wp-playlist' ), false, 1 ); 426 426 427 $scripts->add( 'twemoji', "/wp-includes/js/twemoji$suffix.js", array(), false, 1 ); 428 $scripts->add( 'emoji', "/wp-includes/js/emoji$suffix.js", array( 'twemoji' ), false, 1 ); 429 did_action( 'init' ) && $scripts->localize( 'emoji', 'EmojiSettings', array( 430 /** 431 * Filter the URL where emoji images are hosted. 432 * 433 * @since 4.2.0 434 * 435 * @param string The emoji base URL. 436 */ 437 'base_url' => apply_filters( 'emoji_url', '//s0.wp.com/wp-content/mu-plugins/emoji/twemoji/72x72/' ), 438 /** 439 * Filter the extension of the emoji files. 440 * 441 * @since 4.2.0 442 * 443 * @param string The emoji extension. 444 */ 445 'ext' => apply_filters( 'emoji_ext', '.png' ), 446 ) ); 447 $scripts->enqueue( 'emoji' ); 448 427 449 if ( is_admin() ) { 428 450 $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), false, 1 ); -
trunk/tests/phpunit/tests/dependencies/styles.php
r31031 r31733 13 13 $this->old_wp_styles = $GLOBALS['wp_styles']; 14 14 remove_action( 'wp_default_styles', 'wp_default_styles' ); 15 remove_action( 'wp_print_styles', 'print_emoji_styles' ); 15 16 $GLOBALS['wp_styles'] = new WP_Styles(); 16 17 $GLOBALS['wp_styles']->default_version = get_bloginfo( 'version' ); … … 20 21 $GLOBALS['wp_styles'] = $this->old_wp_styles; 21 22 add_action( 'wp_default_styles', 'wp_default_styles' ); 23 add_action( 'wp_print_styles', 'print_emoji_styles' ); 22 24 parent::tearDown(); 23 25 } -
trunk/tests/phpunit/tests/formatting/Smilies.php
r28717 r31733 17 17 array ( 18 18 'Lorem ipsum dolor sit amet mauris ;-) Praesent gravida sodales. :lol: Vivamus nec diam in faucibus eu, bibendum varius nec, imperdiet purus est, at augue at lacus malesuada elit dapibus a, :eek: mauris. Cras mauris viverra elit. Nam laoreet viverra. Pellentesque tortor. Nam libero ante, porta urna ut turpis. Nullam wisi magna, :mrgreen: tincidunt nec, sagittis non, fringilla enim. Nam consectetuer nec, ullamcorper pede eu dui odio consequat vel, vehicula tortor quis pede turpis cursus quis, egestas ipsum ultricies ut, eleifend velit. Mauris vestibulum iaculis. Sed in nunc. Vivamus elit porttitor egestas. Mauris purus :?:', 19 'Lorem ipsum dolor sit amet mauris <img src="' . $includes_path . 'icon_wink.gif" alt=";-)" class="wp-smiley" /> Praesent gravida sodales. <img src="' . $includes_path . 'icon_lol.gif" alt=":lol:" class="wp-smiley" /> Vivamus nec diam in faucibus eu, bibendum varius nec, imperdiet purus est, at augue at lacus malesuada elit dapibus a, <img src="' . $includes_path . 'icon_surprised.gif" alt=":eek:" class="wp-smiley" /> mauris. Cras mauris viverra elit. Nam laoreet viverra. Pellentesque tortor. Nam libero ante, porta urna ut turpis. Nullam wisi magna, <img src="' . $includes_path . 'icon_mrgreen.gif" alt=":mrgreen:" class="wp-smiley" /> tincidunt nec, sagittis non, fringilla enim. Nam consectetuer nec, ullamcorper pede eu dui odio consequat vel, vehicula tortor quis pede turpis cursus quis, egestas ipsum ultricies ut, eleifend velit. Mauris vestibulum iaculis. Sed in nunc. Vivamus elit porttitor egestas. Mauris purus <img src="' . $includes_path . 'icon_question.gif" alt=":?:" class="wp-smiley" />'19 "Lorem ipsum dolor sit amet mauris \xf0\x9f\x98\x89 Praesent gravida sodales. \xf0\x9f\x98\x84 Vivamus nec diam in faucibus eu, bibendum varius nec, imperdiet purus est, at augue at lacus malesuada elit dapibus a, \xf0\x9f\x98\xaf mauris. Cras mauris viverra elit. Nam laoreet viverra. Pellentesque tortor. Nam libero ante, porta urna ut turpis. Nullam wisi magna, <img src=\"${includes_path}mrgreen.png\" alt=\":mrgreen:\" class=\"wp-smiley\" /> tincidunt nec, sagittis non, fringilla enim. Nam consectetuer nec, ullamcorper pede eu dui odio consequat vel, vehicula tortor quis pede turpis cursus quis, egestas ipsum ultricies ut, eleifend velit. Mauris vestibulum iaculis. Sed in nunc. Vivamus elit porttitor egestas. Mauris purus \xe2\x9d\x93" 20 20 ), 21 21 array ( 22 22 '<strong>Welcome to the jungle!</strong> We got fun n games! :) We got everything you want 8-) <em>Honey we know the names :)</em>', 23 '<strong>Welcome to the jungle!</strong> We got fun n games! <img src="' . $includes_path . 'icon_smile.gif" alt=":)" class="wp-smiley" /> We got everything you want <img src="' . $includes_path . 'icon_cool.gif" alt="8-)" class="wp-smiley" /> <em>Honey we know the names <img src="' . $includes_path . 'icon_smile.gif" alt=":)" class="wp-smiley" /></em>'23 "<strong>Welcome to the jungle!</strong> We got fun n games! <img src=\"${includes_path}simple-smile.png\" alt=\":)\" class=\"wp-smiley\" /> We got everything you want \xf0\x9f\x98\x8e <em>Honey we know the names <img src=\"${includes_path}simple-smile.png\" alt=\":)\" class=\"wp-smiley\" /></em>" 24 24 ), 25 25 array ( 26 26 "<strong;)>a little bit of this\na little bit:other: of that :D\n:D a little bit of good\nyeah with a little bit of bad8O", 27 "<strong;)>a little bit of this\na little bit:other: of that <img src=\"{$includes_path}icon_biggrin.gif\" alt=\":D\" class=\"wp-smiley\" />\n<img src=\"{$includes_path}icon_biggrin.gif\" alt=\":D\" class=\"wp-smiley\" />a little bit of good\nyeah with a little bit of bad8O"27 "<strong;)>a little bit of this\na little bit:other: of that \xf0\x9f\x98\x84\n\xf0\x9f\x98\x84 a little bit of good\nyeah with a little bit of bad8O" 28 28 ), 29 29 array ( … … 148 148 149 149 $in_str = 'Do we ingore smilies ;-) in ' . $element . ' tags <' . $element . '>My Content Here :?: </' . $element . '>'; 150 $exp_str = 'Do we ingore smilies <img src="' . $includes_path . 'icon_wink.gif" alt=";-)" class="wp-smiley" /> in ' . $element . ' tags <' . $element . '>My Content Here :?: </' . $element . '>';150 $exp_str = "Do we ingore smilies \xf0\x9f\x98\x89 in $element tags <$element>My Content Here :?: </$element>"; 151 151 152 152 // standard smilies, use_smilies: ON … … 170 170 array ( 171 171 '8-O :-(', 172 '<img src="' . $includes_path . 'icon_eek.gif" alt="8-O" class="wp-smiley" /> <img src="' . $includes_path . 'icon_sad.gif" alt=":-(" class="wp-smiley" />'172 "\xf0\x9f\x98\xaf \xf0\x9f\x98\xa6" 173 173 ), 174 174 array ( 175 175 '8-) 8-O', 176 '<img src="' . $includes_path . 'icon_cool.gif" alt="8-)" class="wp-smiley" /> <img src="' . $includes_path . 'icon_eek.gif" alt="8-O" class="wp-smiley" />'176 "\xf0\x9f\x98\x8e \xf0\x9f\x98\xaf" 177 177 ), 178 178 array ( 179 179 '8-) 8O', 180 '<img src="' . $includes_path . 'icon_cool.gif" alt="8-)" class="wp-smiley" /> <img src="' . $includes_path . 'icon_eek.gif" alt="8O" class="wp-smiley" />'180 "\xf0\x9f\x98\x8e \xf0\x9f\x98\xaf" 181 181 ), 182 182 array ( 183 183 '8-) :-(', 184 '<img src="' . $includes_path . 'icon_cool.gif" alt="8-)" class="wp-smiley" /> <img src="' . $includes_path . 'icon_sad.gif" alt=":-(" class="wp-smiley" />'184 "\xf0\x9f\x98\x8e \xf0\x9f\x98\xa6" 185 185 ), 186 186 array ( 187 187 '8-) :twisted:', 188 '<img src="' . $includes_path . 'icon_cool.gif" alt="8-)" class="wp-smiley" /> <img src="' . $includes_path . 'icon_twisted.gif" alt=":twisted:" class="wp-smiley" />'188 "\xf0\x9f\x98\x8e \xf0\x9f\x98\x88" 189 189 ), 190 190 array ( 191 191 '8O :twisted: :( :? :(', 192 '<img src="' . $includes_path . 'icon_eek.gif" alt="8O" class="wp-smiley" /> <img src="' . $includes_path . 'icon_twisted.gif" alt=":twisted:" class="wp-smiley" /> <img src="' . $includes_path . 'icon_sad.gif" alt=":(" class="wp-smiley" /> <img src="' . $includes_path . 'icon_confused.gif" alt=":?" class="wp-smiley" /> <img src="' . $includes_path . 'icon_sad.gif" alt=":(" class="wp-smiley" />'192 "\xf0\x9f\x98\xaf \xf0\x9f\x98\x88 \xf0\x9f\x98\xa6 \xf0\x9f\x98\xaf \xf0\x9f\x98\xa6" 193 193 ), 194 194 ); … … 229 229 array ( 230 230 '8O :) additional text here :)', 231 '8O <img src="' . $includes_path . ' icon_smile.gif" alt=":)" class="wp-smiley" /> additional text here <img src="' . $includes_path . 'icon_smile.gif" alt=":)" class="wp-smiley" />'231 '8O <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" /> additional text here <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" />' 232 232 ), 233 233 array ( 234 234 ':) :) :) :)', 235 '<img src="' . $includes_path . ' icon_smile.gif" alt=":)" class="wp-smiley" /> <img src="' . $includes_path . 'icon_smile.gif" alt=":)" class="wp-smiley" /> <img src="' . $includes_path . 'icon_smile.gif" alt=":)" class="wp-smiley" /> <img src="' . $includes_path . 'icon_smile.gif" alt=":)" class="wp-smiley" />'235 '<img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" /> <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" /> <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" /> <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" />' 236 236 ), 237 237 ); … … 258 258 259 259 $wpsmiliestrans = array ( 260 ':)' => ' icon_smile.gif'260 ':)' => 'simple-smile.png' 261 261 ); 262 262 … … 295 295 $output[] = array('test <img ', 'alt=":)"', ' /> smile'); 296 296 297 $input[] = 'My test ;) smile';298 $output[] = array('test <img ', 'alt=";)"', ' /> smile');299 300 297 $input[] = 'My test :) smile'; 301 298 $output[] = array('test <img ', 'alt=":)"', ' /> smile'); 302 299 303 $input[] = 'My test ;) smile';304 $output[] = array('test <img ', 'alt=";)"', ' /> smile');305 306 300 $input[] = "My test {$nbsp}:){$nbsp}smile"; 307 301 $output[] = array("test {$nbsp}<img ", 'alt=":)"', " />{$nbsp}smile"); 308 309 $input[] = "My test {$nbsp};){$nbsp}smile";310 $output[] = array("test {$nbsp}<img ", 'alt=";)"', " />{$nbsp}smile");311 302 312 303 foreach($input as $key => $in) {
Note: See TracChangeset
for help on using the changeset viewer.