-
Notifications
You must be signed in to change notification settings - Fork 7.8k
ini_parse_quantity() accepts invalid arguments as valid #11876
New issue
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
Comments
The "issue" is the call to ```ZEND_STRTOUL()``, this is part of the issue when introducing support for binary and octal prefixes in #9560 The whitespace and prefix is stripped away before passing it to the C The warnings for: var_dump(zend_test_zend_ini_parse_quantity('0b0b10'));
var_dump(zend_test_zend_ini_parse_quantity('0o0o10')); are also a tad weird. I don't really see a good way to fix this, but will try. @arnaud-lb what is your opinion on this? (well after you enjoyed your holiday) |
* PHP-8.2: Fix GH-11876: ini_parse_quantity() accepts invalid quantities
* PHP-8.3: Fix GH-11876: ini_parse_quantity() accepts invalid quantities
Description
While writing a polyfill for
ini_parse_quantity()
I found some invalid inputs that are wrongly accepted as valid.See https://3v4l.org/ON6U1#v8.2.9 for a live demo
The following code:
Resulted in this output:
But I expected this output instead:
E_WARNING
that the data is invalid - similar to other invalid arguments.PHP Version
8.2.9
Operating System
No response
The text was updated successfully, but these errors were encountered: