mirror of
https://github.com/php/php-src.git
synced 2026-03-29 03:32:20 +02:00
Fix stream context changes leaking into copies of previous context
This commit is contained in:
@@ -2231,6 +2231,7 @@ PHPAPI int php_stream_context_set_option(php_stream_context *context,
|
||||
zval *wrapperhash;
|
||||
zval category;
|
||||
|
||||
SEPARATE_ARRAY(&context->options);
|
||||
wrapperhash = zend_hash_str_find(Z_ARRVAL(context->options), wrappername, strlen(wrappername));
|
||||
if (NULL == wrapperhash) {
|
||||
array_init(&category);
|
||||
@@ -2241,6 +2242,7 @@ PHPAPI int php_stream_context_set_option(php_stream_context *context,
|
||||
}
|
||||
ZVAL_DEREF(optionvalue);
|
||||
Z_TRY_ADDREF_P(optionvalue);
|
||||
SEPARATE_ARRAY(wrapperhash);
|
||||
return zend_hash_str_update(Z_ARRVAL_P(wrapperhash), optionname, strlen(optionname), optionvalue) ? SUCCESS : FAILURE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
Reference in New Issue
Block a user