From c701c5781d02ffd140ef17f68853f8bb8007985b Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sat, 6 Jun 2026 08:00:21 +0100 Subject: [PATCH] ext/phar: stream context options are always stored in an array (#22234) These cannot be objects and thus there is no need to use HASH_OF. Can be double-checked looking at stream_context_set_option() and stream_context_set_options() functions. --- ext/phar/stream.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 3fee251d2589..9474498e3892 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -213,8 +213,9 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha php_url_free(resource); efree(internal_file); - if (context && Z_TYPE(context->options) != IS_UNDEF && (pzoption = zend_hash_str_find_ind(HASH_OF(&context->options), "phar", sizeof("phar")-1)) != NULL) { - pharcontext = HASH_OF(pzoption); + if (context && Z_TYPE(context->options) != IS_UNDEF && (pzoption = zend_hash_str_find(Z_ARR(context->options), "phar", sizeof("phar")-1)) != NULL) { + ZEND_ASSERT(Z_TYPE_P(pzoption) == IS_ARRAY); + pharcontext = Z_ARR_P(pzoption); if (idata->internal_file->uncompressed_filesize == 0 && idata->internal_file->compressed_filesize == 0 && (pzoption = zend_hash_str_find_ind(pharcontext, "compress", sizeof("compress")-1)) != NULL