mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Interned strings must not be modified in-place
MAKE_COPY_ZVAL() should be changed into ZVAL_DUP()
This commit is contained in:
parent
37d9f1e6e9
commit
d41d6cf206
2 changed files with 5 additions and 1 deletions
|
@ -776,7 +776,7 @@ PHP_FUNCTION(filter_var)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ZVAL_COPY(return_value, data);
|
||||
ZVAL_DUP(return_value, data);
|
||||
|
||||
php_filter_call(return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR TSRMLS_CC);
|
||||
}
|
||||
|
|
|
@ -184,6 +184,10 @@ void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL)
|
|||
size_t new_len;
|
||||
unsigned char enc[256] = {0};
|
||||
|
||||
if (IS_INTERNED(Z_STR_P(value))) {
|
||||
ZVAL_STRINGL(value, Z_STRVAL_P(value), Z_STRLEN_P(value));
|
||||
}
|
||||
|
||||
/* strip high/strip low ( see flags )*/
|
||||
php_filter_strip(value, flags);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue