From 9a3210759f4d8f96a4f2ae5c93faedab464d691b Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Fri, 23 Feb 2024 05:45:12 +0000 Subject: [PATCH] Script Loader: Inject wp_remove_surrounding_empty_script_tags function name in returned error string using sprintf. The name of this function should not be editable by the translator in the internationalized return error string. Props naoki0h, swissspidy, kirasong. Fixes #60590. Built from https://develop.svn.wordpress.org/trunk@57699 git-svn-id: http://core.svn.wordpress.org/trunk@57200 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-loader.php | 11 ++++++++++- wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index dca355a0a7..a66e8a264c 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -3391,6 +3391,15 @@ function wp_remove_surrounding_empty_script_tags( $contents ) { } else { $error_message = __( 'Expected string to start with script tag (without attributes) and end with script tag, with optional whitespace.' ); _doing_it_wrong( __FUNCTION__, $error_message, '6.4' ); - return sprintf( 'console.error(%s)', wp_json_encode( __( 'Function wp_remove_surrounding_empty_script_tags() used incorrectly in PHP.' ) . ' ' . $error_message ) ); + return sprintf( + 'console.error(%s)', + wp_json_encode( + sprintf( + /* translators: %s: wp_remove_surrounding_empty_script_tags() */ + __( 'Function %s used incorrectly in PHP.' ), + 'wp_remove_surrounding_empty_script_tags()' + ) . ' ' . $error_message + ) + ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 421feed780..1c446efed8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-beta2-57698'; +$wp_version = '6.5-beta2-57699'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.