Skip to content

Commit

Permalink
Add missing arg num check for __set_state
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jul 20, 2020
1 parent dcaf62f commit b466e8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Zend/tests/magic_methods_set_state.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Testing __set_state() declaration with wrong modifier
<?php

class Foo {
function __set_state()
function __set_state($array)
{
}
}
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,8 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
zend_check_magic_method_args(0, "__serialize", ce, fptr, error_type);
} else if (zend_string_equals_literal(lcname, "__unserialize")) {
zend_check_magic_method_args(1, "__unserialize", ce, fptr, error_type);
} else if (zend_string_equals_literal(lcname, "__set_state")) {
zend_check_magic_method_args(1, "__set_state", ce, fptr, error_type);
}
}
/* }}} */
Expand Down

0 comments on commit b466e8b

Please sign in to comment.