From f0352db3e4d83cc266d396d6190e300e2adfe9d6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 14 Apr 2023 01:27:23 +0000 Subject: [PATCH] Coding Standards: Rename the `$myHTML` parameter to `$text` in `htmlentities2()`. This resolves a WPCS warning: {{{ Variable "$myHTML" is not in valid snake_case format, try "$my_h_t_m_l" }}} It also matches other formatting functions with the `$text` parameter, e.g. `esc_html()`, `ent2ncr()`, etc. Follow-up to [1727], [3717], [8662], [8743], [54927]. Props victoranto, audrasjb, jrf. Fixes #58129. Built from https://develop.svn.wordpress.org/trunk@55651 git-svn-id: http://core.svn.wordpress.org/trunk@55163 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 10 ++++++---- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 1f8a51b97c..d9cbd68f27 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -4524,13 +4524,15 @@ function sanitize_url( $url, $protocols = null ) { * * @since 1.2.2 * - * @param string $myHTML The text to be converted. + * @param string $text The text to be converted. * @return string Converted text. */ -function htmlentities2( $myHTML ) { - $translation_table = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES ); +function htmlentities2( $text ) { + $translation_table = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES ); + $translation_table[ chr( 38 ) ] = '&'; - return preg_replace( '/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/', '&', strtr( $myHTML, $translation_table ) ); + + return preg_replace( '/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/', '&', strtr( $text, $translation_table ) ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 53e106143c..c3919e2b01 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55650'; +$wp_version = '6.3-alpha-55651'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.