From 3d1575a001835e301f558537a6835a77d55b31ad Mon Sep 17 00:00:00 2001
From: jrfnl <github_nospam@adviesenzo.nl>
Date: Mon, 28 Mar 2016 18:35:14 +0200
Subject: [PATCH] Fix _wp_json_prepare_data() called unnecessarily early.
---
src/wp-includes/functions.php | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index 0e720ee..b47cce4 100644
a
|
b
|
function wp_json_encode( $data, $options = 0, $depth = 512 ) { |
2861 | 2861 | $args = array( $data ); |
2862 | 2862 | } |
2863 | 2863 | |
2864 | | // Prepare the data for JSON serialization. |
2865 | | $data = _wp_json_prepare_data( $data ); |
2866 | | |
2867 | 2864 | $json = @call_user_func_array( 'json_encode', $args ); |
2868 | 2865 | |
2869 | 2866 | // If json_encode() was successful, no need to do more sanity checking. |
… |
… |
function wp_json_encode( $data, $options = 0, $depth = 512 ) { |
2874 | 2871 | } |
2875 | 2872 | |
2876 | 2873 | try { |
| 2874 | // Prepare the data for JSON serialization. |
| 2875 | $data = _wp_json_prepare_data( $data ); |
2877 | 2876 | $args[0] = _wp_json_sanity_check( $data, $depth ); |
2878 | 2877 | } catch ( Exception $e ) { |
2879 | 2878 | return false; |