WordPress.org

Make WordPress Core

Ticket #36358: 36358-patch1-_wp_json_prepare_data.patch

File 36358-patch1-_wp_json_prepare_data.patch, 814 bytes (added by jrf, 6 years ago)
  • src/wp-includes/functions.php

    From 78e9a2dac142233e2f5e7976a588405affaa280a Mon Sep 17 00:00:00 2001
    From: jrfnl <github_nospam@adviesenzo.nl>
    Date: Mon, 28 Mar 2016 18:31:22 +0200
    Subject: [PATCH] Fix result of _wp_json_prepare_data() is passed to the wrong
     argument.
    
    ---
     src/wp-includes/functions.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
    index 0e720ee..ddf2434 100644
    a b function wp_json_encode( $data, $options = 0, $depth = 512 ) { 
    28622862        }
    28632863
    28642864        // Prepare the data for JSON serialization.
    2865         $data = _wp_json_prepare_data( $data );
     2865        $args[0] = _wp_json_prepare_data( $data );
    28662866
    28672867        $json = @call_user_func_array( 'json_encode', $args );
    28682868