1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Add ZPP checks in DOMNode::{__sleep,__wakeup}

Closes GH-13651.
This commit is contained in:
Niels Dossche
2024-03-09 14:58:57 +01:00
parent 00f9c5eeb4
commit e3711af8ce
2 changed files with 11 additions and 0 deletions

3
NEWS
View File

@@ -6,6 +6,9 @@ PHP NEWS
. Fixed bug GH-13612 (Corrupted memory in destructor with weak references).
(nielsdos)
- DOM:
. Add some missing ZPP checks. (nielsdos)
- Gettext:
. Fixed sigabrt raised with dcgettext/dcngettext calls with gettext 0.22.5
with category set to LC_ALL. (David Carlier)

View File

@@ -1797,12 +1797,20 @@ PHP_METHOD(DOMNode, getLineNo)
PHP_METHOD(DOMNode, __sleep)
{
if (zend_parse_parameters_none() != SUCCESS) {
RETURN_THROWS();
}
zend_throw_exception_ex(NULL, 0, "Serialization of '%s' is not allowed, unless serialization methods are implemented in a subclass", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
RETURN_THROWS();
}
PHP_METHOD(DOMNode, __wakeup)
{
if (zend_parse_parameters_none() != SUCCESS) {
RETURN_THROWS();
}
zend_throw_exception_ex(NULL, 0, "Unserialization of '%s' is not allowed, unless unserialization methods are implemented in a subclass", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
RETURN_THROWS();
}