backporting GH-15755 fix.

This commit is contained in:
Daniel Scherzer 2024-09-05 02:01:22 +01:00 committed by David Carlier
parent 1e62d203a6
commit 29f9f903b1
No known key found for this signature in database
GPG Key ID: CEF290BB40D2086B
3 changed files with 4 additions and 4 deletions

View File

@ -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)) {

View File

@ -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

View File

@ -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