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 22|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33?? ??? ????, PHP 8.2.8
44
5+ - PCRE:
6+ . Fix preg_replace_callback_array() pattern validation. (ilutov)
7+
58- Standard:
69 . Fix access on NULL pointer in array_merge_recursive(). (ilutov)
710
Original file line number Diff line number Diff line change @@ -2425,6 +2425,10 @@ PHP_FUNCTION(preg_replace_callback_array)
24252425 zend_argument_type_error (1 , "must contain only valid callbacks" );
24262426 goto error ;
24272427 }
2428+ if (!str_idx_regex ) {
2429+ zend_argument_type_error (1 , "must contain only string patterns as keys" );
2430+ goto error ;
2431+ }
24282432
24292433 ZVAL_COPY_VALUE (& fci .function_name , replace );
24302434
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