diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 8af1967aacd..52172dfbd69 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -376,7 +376,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime // Implementation is used for both finfo_file() and mimetype_emu() int buffer_param_num = (mimetype_emu ? 1 : 2); if (buffer == NULL || buffer_len == 0) { - zend_argument_must_not_be_empty_error(1); + zend_argument_must_not_be_empty_error(buffer_param_num); goto clean; } if (CHECK_NULL_PATH(buffer, buffer_len)) { diff --git a/ext/fileinfo/tests/finfo_file_001.phpt b/ext/fileinfo/tests/finfo_file_001.phpt index 86ce797a04d..1e31b8ad1c0 100644 --- a/ext/fileinfo/tests/finfo_file_001.phpt +++ b/ext/fileinfo/tests/finfo_file_001.phpt @@ -21,8 +21,8 @@ var_dump(finfo_file($fp, '&')); ?> --EXPECTF-- -finfo_file(): Argument #1 ($finfo) must not contain any null bytes -finfo_file(): Argument #1 ($finfo) must not be empty +finfo_file(): Argument #2 ($filename) must not contain any null bytes +finfo_file(): Argument #2 ($filename) must not be empty string(9) "directory" Warning: finfo_file(&): Failed to open stream: No such file or directory in %s on line %d diff --git a/ext/fileinfo/tests/finfo_file_basic.phpt b/ext/fileinfo/tests/finfo_file_basic.phpt index 2ef61db100b..e6f2b1e8570 100644 --- a/ext/fileinfo/tests/finfo_file_basic.phpt +++ b/ext/fileinfo/tests/finfo_file_basic.phpt @@ -25,4 +25,4 @@ try { string(28) "text/x-php; charset=us-ascii" string(22) "PHP script, ASCII text" string(29) "text/x-file; charset=us-ascii" -finfo_file(): Argument #1 ($finfo) must not contain any null bytes +finfo_file(): Argument #2 ($filename) must not contain any null bytes