From e3554a9aa703d2de656c294711c159abd9665bcb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 8 Sep 2021 17:24:01 +0000 Subject: [PATCH] General: Only use `_jsonp_wp_die_handler()` for JSONP REST API requests. Props mdawaffe, peterwilsoncc. Merges [51740] to the 5.7 branch. Built from https://develop.svn.wordpress.org/branches/5.7@51742 git-svn-id: http://core.svn.wordpress.org/branches/5.7@51350 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 5935f781fb..051e16c9ba 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3376,9 +3376,9 @@ function wp_die( $message = '', $title = '', $args = array() ) { * @param callable $function Callback function name. */ $function = apply_filters( 'wp_die_json_handler', '_json_wp_die_handler' ); - } elseif ( wp_is_jsonp_request() ) { + } elseif ( defined( 'REST_REQUEST' ) && REST_REQUEST && wp_is_jsonp_request() ) { /** - * Filters the callback for killing WordPress execution for JSONP requests. + * Filters the callback for killing WordPress execution for JSONP REST requests. * * @since 5.2.0 * diff --git a/wp-includes/version.php b/wp-includes/version.php index 7dd4277b3d..3640fb4b0e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7.3-alpha-51171'; +$wp_version = '5.7.3-alpha-51742'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.