File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 2
2
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3
3
?? ??? ????, PHP 8.2.8
4
4
5
+ - PCRE:
6
+ . Fix preg_replace_callback_array() pattern validation. (ilutov)
7
+
5
8
- Standard:
6
9
. Fix access on NULL pointer in array_merge_recursive(). (ilutov)
7
10
Original file line number Diff line number Diff line change @@ -2425,6 +2425,10 @@ PHP_FUNCTION(preg_replace_callback_array)
2425
2425
zend_argument_type_error (1 , "must contain only valid callbacks" );
2426
2426
goto error ;
2427
2427
}
2428
+ if (!str_idx_regex ) {
2429
+ zend_argument_type_error (1 , "must contain only string patterns as keys" );
2430
+ goto error ;
2431
+ }
2428
2432
2429
2433
ZVAL_COPY_VALUE (& fci .function_name , replace );
2430
2434
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ preg_replace_callback_array() invalid pattern
3
+ --FILE--
4
+ <?php
5
+ preg_replace_callback_array (
6
+ [42 => function () {}],
7
+ 'a ' ,
8
+ );
9
+ ?>
10
+ --EXPECTF--
11
+ Fatal error: Uncaught TypeError: preg_replace_callback_array(): Argument #1 ($pattern) must contain only string patterns as keys in %s:%d
12
+ Stack trace:
13
+ #0 %s(%d): preg_replace_callback_array(Array, 'a')
14
+ #1 {main}
15
+ thrown in %s on line %d
You can’t perform that action at this time.
0 commit comments