Make WordPress Core


Ignore:
Timestamp:
06/18/2024 05:39:13 PM (3 months ago)
Author:
dmsnell
Message:

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].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/html-api/class-wp-html-open-elements.php

    r58304 r58441  
    518518        }
    519519    }
     520
     521    /**
     522     * Wakeup magic method.
     523     *
     524     * @since 6.6.0
     525     */
     526    public function __wakeup() {
     527        throw new \LogicException( __CLASS__ . ' should never be unserialized' );
     528    }
    520529}
Note: See TracChangeset for help on using the changeset viewer.