WordPress.org

Make WordPress Core

Ticket #47678: 47678-wp_specialchars.patch

File 47678-wp_specialchars.patch, 1.0 KB (added by jrf, 8 months ago)

Simplify wp_specialchars()

  • src/wp-includes/deprecated.php

    From 276917a6a6d38511e7c6eccc2e4434d16b68c705 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Sat, 20 Jul 2019 06:48:03 +0200
    Subject: [PATCH] Simplify wp_specialchars()
    
    ---
     src/wp-includes/deprecated.php | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php
    index ce12741fcc..60926e690c 100644
    a b function js_escape( $text ) { 
    20682068function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
    20692069        _deprecated_function( __FUNCTION__, '2.8.0', 'esc_html()' );
    20702070        if ( func_num_args() > 1 ) { // Maintain back-compat for people passing additional arguments.
    2071                 $args = func_get_args();
    2072                 return call_user_func_array( '_wp_specialchars', $args );
     2071                return _wp_specialchars( $string, $quote_style, $charset, $double_encode );
    20732072        } else {
    20742073                return esc_html( $string );
    20752074        }