We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
finfo_file()
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code:
<?php $info = finfo_open(FILEINFO_MIME_TYPE); if ($info) { echo finfo_file($info, '') . PHP_EOL; }
Resulted in this output:
PHP Fatal error: Uncaught ValueError: finfo_file(): Argument #1 ($finfo) cannot be empty in /some/dir/example.php:5
But I expected this output instead:
PHP Fatal error: Uncaught ValueError: finfo_file(): Argument #2 ($filename) cannot be empty in /some/dir/example.php:5
The empty second argument is miss-attributed in the error message to the first argument.
If a non-empty string e.g. "foo" is passed as the second filename argument this error does not occur.
"foo"
filename
PHP 8.1-8.3
Ubuntu 18.04
The text was updated successfully, but these errors were encountered:
Caused by the wrong parameter to zend_argument_value_error() (8.2, 8.3) or zend_argument_must_not_be_empty_error() (8.4) in _php_finfo_get_type()
zend_argument_value_error()
zend_argument_must_not_be_empty_error()
_php_finfo_get_type()
Sorry, something went wrong.
Fix phpGH-15752: finfo_file() - parameter validation error message
ad37fc1
Show the correct parameter name and number - the error is caused by the second parameter being empty, not the first.
Patch at #15755
Fix phpGH-15752: finfo_file() - parameter validation error messages
056cfe7
Show the correct parameter names and numbers - the errors are caused by the second parameter being empty or having null bytes, not the first.
ed32452
c5e0a6a
No branches or pull requests
Description
The following code:
Resulted in this output:
But I expected this output instead:
The empty second argument is miss-attributed in the error message to the first argument.
If a non-empty string e.g.
"foo"
is passed as the secondfilename
argument this error does not occur.PHP Version
PHP 8.1-8.3
Operating System
Ubuntu 18.04
The text was updated successfully, but these errors were encountered: