Commit 272cbe0748 for wordpress.org

commit 272cbe0748de4deb38605ef92dea4d09ed8d7ff9
Author: dmsnell <dmsnell@git.wordpress.org>
Date:   Wed Sep 30 20:22:50 2026 +0000

    KSES: Deprecate wp_kses_html_error().

    `wp_kses_hair()` was updated in WordPress 7.0.0 and was the only place in Core calling `wp_kses_html_error()`. This change deprecates the leftover function and moves it into `deprecated.php`.

    Developed in: https://github.com/WordPress/wordpress-develop/pull/13821
    Discussed in: https://core.trac.wordpress.org/ticket/63724

    Follow-up to r61467.

    Props dmsnell, westonruter.
    Fixes #63724.

    Built from https://develop.svn.wordpress.org/trunk@64027


    git-svn-id: http://core.svn.wordpress.org/trunk@63187 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php
index 76d3971085..df621af926 100644
--- a/wp-includes/deprecated.php
+++ b/wp-includes/deprecated.php
@@ -3843,6 +3843,30 @@ function get_paged_template() {
 	return get_query_template( 'paged' );
 }

+/**
+ * Handles parsing errors in `wp_kses_hair()`.
+ *
+ * The general plan is to remove everything to and including some whitespace,
+ * but it deals with quotes and apostrophes as well.
+ *
+ * Note: This was previously used in certain cases when {@see \wp_kses_hair()}
+ *       struggled to recognize HTML syntax. Since 7.0.0 when that function was
+ *       rewritten to rely on the HTML API, those ambiguous situations no longer
+ *       exist, and this function is no longer relevant.
+ *
+ * @since 1.0.0
+ * @deprecated 7.2.0 This was only meant to be used internally and the calling
+ *                   function has been updated and no-longer needs it.
+ *
+ * @param string $attr
+ * @return string
+ */
+function wp_kses_html_error( $attr ) {
+	_deprecated_function( __FUNCTION__, '7.2.0' );
+
+	return preg_replace( '/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $attr );
+}
+
 /**
  * Removes the HTML JavaScript entities found in early versions of Netscape 4.
  *
diff --git a/wp-includes/kses.php b/wp-includes/kses.php
index f6ef8a1ed1..ea7db4f9c4 100644
--- a/wp-includes/kses.php
+++ b/wp-includes/kses.php
@@ -2068,21 +2068,6 @@ function wp_kses_array_lc( $inarray ) {
 	return $outarray;
 }

-/**
- * Handles parsing errors in `wp_kses_hair()`.
- *
- * The general plan is to remove everything to and including some whitespace,
- * but it deals with quotes and apostrophes as well.
- *
- * @since 1.0.0
- *
- * @param string $attr
- * @return string
- */
-function wp_kses_html_error( $attr ) {
-	return preg_replace( '/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $attr );
-}
-
 /**
  * Sanitizes content from bad protocols and other characters.
  *
diff --git a/wp-includes/version.php b/wp-includes/version.php
index d9267e828b..6e90a945e4 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.2-alpha-64026';
+$wp_version = '7.2-alpha-64027';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.