Ticket #31328: 31328.diff
File 31328.diff, 2.1 KB (added by , 10 years ago) |
---|
-
src/wp-includes/formatting.php
785 785 $unicode .= chr($value); 786 786 $unicode_length++; 787 787 } else { 788 if ( count( $values ) == 0 ) $num_octets = ( $value < 224 ) ? 2 : 3; 788 if ( count( $values ) == 0 ) { 789 if ( $value < 224 ) { 790 $num_octets = 2; 791 } elseif ( $value < 240 ) { 792 $num_octets = 3; 793 } else { 794 $num_octets = 4; 795 } 796 } 789 797 790 798 $values[] = $value; 791 799 792 800 if ( $length && ( $unicode_length + ($num_octets * 3) ) > $length ) 793 801 break; 794 802 if ( count( $values ) == $num_octets ) { 795 if ($num_octets == 3) { 796 $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]) . '%' . dechex($values[2]); 797 $unicode_length += 9; 798 } else { 799 $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]); 800 $unicode_length += 6; 803 for ( $j = 0; $j < $num_octets; $j++ ) { 804 $unicode .= '%' . dechex( $values[ $j ] ); 801 805 } 802 806 807 $unicode_length += $num_octets * 3; 808 803 809 $values = array(); 804 810 $num_octets = 1; 805 811 } -
src/wp-admin/js/post.js
712 712 revert_slug = real_slug.val(), 713 713 b = $('#edit-slug-buttons'), 714 714 revert_b = b.html(), 715 full = $('#editable-post-name-full') .html();715 full = $('#editable-post-name-full'); 716 716 717 // Deal with Twemoji in the post-name 718 full.find( 'img' ).replaceWith( function() { return this.alt; } ); 719 full = full.html(); 720 717 721 $('#view-post-btn').hide(); 718 722 b.html('<a href="#" class="save button button-small">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+'</a>'); 719 723 b.children('.save').click(function() { … … 736 740 box.removeClass('hidden'); 737 741 }); 738 742 } 743 744 if ( WPEmoji ) { 745 WPEmoji.parse( box.get( 0 ) ); 746 } 747 739 748 b.html(revert_b); 740 749 real_slug.val(new_slug); 741 750 $('#view-post-btn').show();