mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fixed altering $this via argument named "this"
This commit is contained in:
parent
cd32cab680
commit
d8ce0568ef
1
NEWS
1
NEWS
@ -3,6 +3,7 @@ PHP NEWS
|
||||
?? ??? 2007, PHP 5.2.3
|
||||
- Fixed ext/filter Email Validation Vulnerability (MOPB-24 by Stefan Esser)
|
||||
(Ilia)
|
||||
- Fixed altering $this via argument named "this". (Dmitry)
|
||||
|
||||
03 May 2007, PHP 5.2.2
|
||||
- Improved bundled GD
|
||||
|
@ -1265,9 +1265,18 @@ void zend_do_end_function_declaration(znode *function_token TSRMLS_DC)
|
||||
|
||||
void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initialization, znode *class_type, znode *varname, zend_uchar pass_by_reference TSRMLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
zend_op *opline;
|
||||
zend_arg_info *cur_arg_info;
|
||||
|
||||
if (CG(active_op_array)->scope &&
|
||||
((CG(active_op_array)->fn_flags & ZEND_ACC_STATIC) == 0) &&
|
||||
(Z_TYPE(varname->u.constant) == IS_STRING) &&
|
||||
(Z_STRLEN(varname->u.constant) == sizeof("this")-1) &&
|
||||
(memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this")) == 0)) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
CG(active_op_array)->num_args++;
|
||||
opline->opcode = op;
|
||||
opline->result = *var;
|
||||
|
Loading…
Reference in New Issue
Block a user