From 46406afcc4cc938f44115c49ae775bad52039710 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Wed, 6 Dec 2023 16:05:19 +0000 Subject: [PATCH] HTML-API: Prevent unintended behavior when WP_HTML_Token is unserialized. Props dmsnell, peterwilsoncc, dd32, xknown, rawrly, johnbillion, barry, jeffpaul, vortfu, isabel_brison, mikeschroder, jorbin. Built from https://develop.svn.wordpress.org/trunk@57163 git-svn-id: http://core.svn.wordpress.org/trunk@56674 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/html-api/class-wp-html-token.php | 9 +++++++++ wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/wp-includes/html-api/class-wp-html-token.php b/wp-includes/html-api/class-wp-html-token.php index f6edd52355..86dd7658cf 100644 --- a/wp-includes/html-api/class-wp-html-token.php +++ b/wp-includes/html-api/class-wp-html-token.php @@ -94,4 +94,13 @@ class WP_HTML_Token { call_user_func( $this->on_destroy, $this->bookmark_name ); } } + + /** + * Wakeup magic method. + * + * @since 6.4.2 + */ + public function __wakeup() { + throw new \LogicException( __CLASS__ . ' should never be unserialized' ); + } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 19aeb58075..3fab07e1ee 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57162'; +$wp_version = '6.5-alpha-57163'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.