Make WordPress Core

Ticket #37731: 37731.4.patch

File 37731.4.patch, 1.1 KB (added by ionutst, 7 years ago)
  • src/wp-includes/functions.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    28712871 * @return string|false The JSON encoded string, or false if it cannot be encoded.
    28722872 */
    28732873function wp_json_encode( $data, $options = 0, $depth = 512 ) {
     2874        // Prepare the data for JSON serialization.
     2875    $data = _wp_json_prepare_data( $data );
     2876
    28742877        /*
    28752878         * json_encode() has had extra params added over the years.
    28762879         * $options was added in 5.3, and $depth in 5.5.
     
    28842887                $args = array( $data );
    28852888        }
    28862889
    2887         // Prepare the data for JSON serialization.
    2888         $args[0] = _wp_json_prepare_data( $data );
    28892890
    28902891        $json = @call_user_func_array( 'json_encode', $args );
    28912892
     
    28972898        }
    28982899
    28992900        try {
    2900                 $args[0] = _wp_json_sanity_check( $data, $depth );
     2901                $args[0] = _wp_json_sanity_check( $args[0], $depth );
    29012902        } catch ( Exception $e ) {
    29022903                return false;
    29032904        }