From e9b86ce6d0d597fbf0bb54411ce935b947dbaf33 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Sun, 2 Jun 2024 22:35:10 +0000 Subject: [PATCH] Script Loader: Add missing escaping function to `Moment.js` string localization. This changeset avoids breaking the inline script added for `Moment.js` localization if for some reason `get_user_locale()` doesn't return a simply string. Props swissspidy. Fixes #61341. Built from https://develop.svn.wordpress.org/trunk@58288 git-svn-id: http://core.svn.wordpress.org/trunk@57748 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-loader.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index f9813ed87c..7c960a2d91 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -144,7 +144,7 @@ function wp_default_packages_vendor( $scripts ) { 'moment', sprintf( "moment.updateLocale( '%s', %s );", - get_user_locale(), + esc_js( get_user_locale() ), wp_json_encode( array( 'months' => array_values( $wp_locale->month ), diff --git a/wp-includes/version.php b/wp-includes/version.php index 273ddf66ca..2ad8afcfab 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58287'; +$wp_version = '6.6-alpha-58288'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.