HTML API: Prevent Open Elements class from waking up.

This class accepts a Closure, but it should not be possible
to wake up with one from a serialized class instance.

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

Props jonsurrell.
See #61348.
Follow-up to [58304].

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


git-svn-id: http://core.svn.wordpress.org/trunk@57890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dmsnell 2024-06-18 17:41:08 +00:00
parent 6eef6c73ce
commit c15b15dd66
2 changed files with 10 additions and 1 deletions

View File

@ -517,4 +517,13 @@ class WP_HTML_Open_Elements {
( $this->pop_handler )( $item );
}
}
/**
* Wakeup magic method.
*
* @since 6.6.0
*/
public function __wakeup() {
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
}
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-beta3-58440';
$wp_version = '6.6-beta3-58441';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.