From 44173677fae3f125402c4161d78d05ee6ef1a81f Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Wed, 12 Jul 2023 05:19:39 +0000 Subject: [PATCH] General: Escape nonce used for block theme activation. Add `wp_json_encode()` as an escaping function when setting the `WP_BLOCK_THEME_ACTIVATE_NONCE` global on the block theme preview screen. This account for custom nonce implementations making use of special characters that require escaping in JavaScript strings. Props antonvlasenko, ramonopoly. Fixes #58712. git-svn-id: https://develop.svn.wordpress.org/trunk@56218 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/theme-previews.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/theme-previews.php b/src/wp-includes/theme-previews.php index d9325ddbf3..e8e4a6a8c8 100644 --- a/src/wp-includes/theme-previews.php +++ b/src/wp-includes/theme-previews.php @@ -70,7 +70,7 @@ function wp_block_theme_activate_nonce() { $nonce_handle = 'switch-theme_' . wp_get_theme_preview_path(); ?>