Commit 072c36cf257 for php
commit 072c36cf2579c93f9292357846ca5d0791fa15a0
Merge: 2f38cdadf79 1cdfa4dacd6
Author: Weilin Du <weilindu@php.net>
Date: Sat Dec 5 12:09:34 2026 +0800
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
Fix GH-26058: filter_var_array() ignores options passed by reference (#26060)
diff --cc NEWS
index 6a34ae5b1ea,2d97165c2ec..863d640293a
--- a/NEWS
+++ b/NEWS
@@@ -6,11 -6,13 +6,15 @@@ PH
. Fixed enchant_broker_set_dict_path() and enchant_broker_get_dict_path()
returning null with libenchant 2. Both now return false. (lacatoire)
+ - Filter:
+ . Fixed bug GH-26058 (Creating a reference to a filter_var_array option
+ breaks the filtering). (Harp404)
+
- Intl:
- . Fixed stale or missing global error code and message in MessageFormatter
- and IntlDateFormatter::formatObject(). (ChrisAbner)
+ . Fixed Locale::isRightToLeft() and locale_is_right_to_left() retaining a
+ stale global intl error after a successful call. (ChrisAbner)
+ . Fixed NULL pointer dereference in IntlListFormatter::format() on an
+ unconstructed object. (hohphu8)
- ODBC:
. Fixed bug GH-26053 (Odbc\Result not freed when its last reference is
diff --cc ext/filter/filter.c
index cd021390f26,58bafee1271..3dcb2e47f5e
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@@ -660,15 -595,8 +660,16 @@@ static void php_filter_array_handler(zv
} else {
zval nval;
ZVAL_DEREF(tmp);
+ ZVAL_DEREF(arg_elm);
ZVAL_DUP(&nval, tmp);
+
+ if (Z_TYPE_P(arg_elm) != IS_ARRAY) {
+ zend_long filter_id = zval_get_long(arg_elm);
+ if (!PHP_FILTER_ID_EXISTS(filter_id)) {
+ php_error_docref(NULL, E_WARNING, "Unknown filter with ID " ZEND_LONG_FMT, filter_id);
+ }
+ }
+
php_filter_call(&nval, -1,
Z_TYPE_P(arg_elm) == IS_ARRAY ? Z_ARRVAL_P(arg_elm) : NULL,
Z_TYPE_P(arg_elm) == IS_ARRAY ? 0 : zval_get_long(arg_elm),