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
This commit is contained in:
audrasjb 2024-06-02 22:35:10 +00:00
parent 6c8e2bcb90
commit e9b86ce6d0
2 changed files with 2 additions and 2 deletions

View File

@ -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 ),

View File

@ -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.