File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -243,12 +243,16 @@ static ZEND_FUNCTION(zend_test_compile_string)
243243
244244 ZEND_PARSE_PARAMETERS_START (3 , 3 )
245245 Z_PARAM_STR (source_string )
246- Z_PARAM_PATH_STR_EX (filename , 1 , 0 )
246+ Z_PARAM_PATH_STR (filename )
247247 Z_PARAM_LONG (position )
248248 ZEND_PARSE_PARAMETERS_END ();
249249
250250 zend_op_array * op_array = NULL ;
251251
252+ if (zend_str_has_nul_byte (filename )) {
253+ return ;
254+ }
255+
252256 op_array = compile_string (source_string , ZSTR_VAL (filename ), position );
253257
254258 if (op_array ) {
Original file line number Diff line number Diff line change 4949 echo $ e ->getMessage (), PHP_EOL ;
5050}
5151
52+ zend_test_compile_string ($ x , $ y , $ z );
5253
5354$ source_string = <<<EOF
5455<?php
5859zend_test_compile_string ($ source_string , 'Source string ' , ZEND_COMPILE_POSITION_AFTER_OPEN_TAG );
5960
6061?>
61- --EXPECT --
62+ --EXPECTF --
6263string(3) "php"
6364#!/path/to/php
6465string(3) "php"
6566string(3) "php"
6667string(3) "php"
6768zend_test_compile_string(): Argument #2 ($filename) must not contain any null bytes
6869
70+ Warning: Undefined variable $x in %s on line %d
71+
72+ Warning: Undefined variable $y in %s on line %d
73+
74+ Warning: Undefined variable $z in %s on line %d
75+
76+ Deprecated: zend_test_compile_string(): Passing null to parameter #1 ($source_string) of type string is deprecated in %s on line %d
77+
78+ Deprecated: zend_test_compile_string(): Passing null to parameter #2 ($filename) of type string is deprecated in %s on line %d
79+
80+ Deprecated: zend_test_compile_string(): Passing null to parameter #3 ($position) of type int is deprecated in %s on line %d
81+
6982Parse error: syntax error, unexpected token "<", expecting end of file in Source string on line 1
You can’t perform that action at this time.
0 commit comments