Skip to content

Commit 29f9f90

Browse files
DanielEScherzerdevnexen
authored andcommitted
backporting GH-15755 fix.
1 parent 1e62d20 commit 29f9f90

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ext/fileinfo/fileinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
376376
// Implementation is used for both finfo_file() and mimetype_emu()
377377
int buffer_param_num = (mimetype_emu ? 1 : 2);
378378
if (buffer == NULL || buffer_len == 0) {
379-
zend_argument_must_not_be_empty_error(1);
379+
zend_argument_must_not_be_empty_error(buffer_param_num);
380380
goto clean;
381381
}
382382
if (CHECK_NULL_PATH(buffer, buffer_len)) {

ext/fileinfo/tests/finfo_file_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ var_dump(finfo_file($fp, '&'));
2121

2222
?>
2323
--EXPECTF--
24-
finfo_file(): Argument #1 ($finfo) must not contain any null bytes
25-
finfo_file(): Argument #1 ($finfo) must not be empty
24+
finfo_file(): Argument #2 ($filename) must not contain any null bytes
25+
finfo_file(): Argument #2 ($filename) must not be empty
2626
string(9) "directory"
2727

2828
Warning: finfo_file(&): Failed to open stream: No such file or directory in %s on line %d

ext/fileinfo/tests/finfo_file_basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ try {
2525
string(28) "text/x-php; charset=us-ascii"
2626
string(22) "PHP script, ASCII text"
2727
string(29) "text/x-file; charset=us-ascii"
28-
finfo_file(): Argument #1 ($finfo) must not contain any null bytes
28+
finfo_file(): Argument #2 ($filename) must not contain any null bytes

0 commit comments

Comments
 (0)