Make WordPress Core

Ticket #46845: 46845.diff

File 46845.diff, 2.7 KB (added by subrataemfluence, 5 years ago)

Proposed patch.

  • wp-includes/formatting.php

    diff --git wp-includes/formatting.php wp-includes/formatting.php
    index 835862c..fa6426e 100755
    function seems_utf8( $str ) { 
    939939 *                                   Also compatible with old values; converting single quotes if set to 'single',
    940940 *                                   double if set to 'double' or both if otherwise set.
    941941 *                                   Default is ENT_NOQUOTES.
    942  * @param string     $charset        Optional. The character encoding of the string. Default is false.
    943  * @param bool       $double_encode  Optional. Whether to encode existing html entities. Default is false.
     942 * @param false|string   $charset    Optional. The character encoding of the string. Default is false.
     943 * @param bool           $double_encode  Optional. Whether to encode existing html entities. Default is false.
    944944 * @return string The encoded text with HTML entities.
    945945 */
    946946function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
    function translate_smiley( $matches ) { 
    31873187         * @param string $site_url   Site URL, as returned by site_url().
    31883188         */
    31893189        $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
    3190 
     3190       
     3191        /* translators: %s: smiley image URL */
    31913192        return sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', esc_url( $src_url ), esc_attr( $smiley ) );
    31923193}
    31933194
    function sanitize_email( $email ) { 
    35993600 *
    36003601 * @since 1.5.0
    36013602 *
    3602  * @param int $from Unix timestamp from which the difference begins.
    3603  * @param int $to   Optional. Unix timestamp to end the time difference. Default becomes time() if not set.
     3603 * @param int        $from Unix timestamp from which the difference begins.
     3604 * @param string|int $to   Optional. Unix timestamp to end the time difference. Default becomes time() if not set.
    36043605 * @return string Human readable time difference.
    36053606 */
    36063607function human_time_diff( $from, $to = '' ) {
    function wp_pre_kses_less_than_callback( $matches ) { 
    47994800 * @link https://secure.php.net/sprintf
    48004801 *
    48014802 * @param string $pattern   The string which formatted args are inserted.
    4802  * @param mixed  $args ,... Arguments to be formatted into the $pattern string.
     4803 *
    48034804 * @return string The formatted string.
    48044805 */
    48054806function wp_sprintf( $pattern ) {
    function wp_staticize_emoji( $text ) { 
    56315632
    56325633                                $file = str_replace( ';&#x', '-', $emojum );
    56335634                                $file = str_replace( array( '&#x', ';' ), '', $file );
     5635                               
     5636                                /* translators: %s: emoji URL */
    56345637
    56355638                                $entity = sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', $cdn_url . $file . $ext, $emoji_char );
    56365639