-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Upcoming deprecation of mt_rand() #6275
Comments
* provide a workaround function in code/Common like is_php does * closes bcit-ci/CodeIgniter#6275 * related to pocketarc/codeigniter#3 (comment)
* provide a workaround function in code/Common like is_php does * closes bcit-ci/CodeIgniter#6275 * related to pocketarc/codeigniter#3 (comment)
* provide a workaround function in code/Common like is_php does * closes bcit-ci/CodeIgniter#6275 * related to pocketarc/codeigniter#3 (comment)
@poodle123 I don't think the |
The feature in And
|
Sure, it shouldn't be used for generating cryptographically secure values. CI only uses it in that context as a poor-man's fallback in case all of the secure random bytes functions are unavailable. Arguably, that should result in an exception rather than a silent failure/fallback. If CI's random bytes function can't return a value, I don't think |
In order to future-proof CI3 mt_rand() should be replaced with random_int(PHP_INT_MIN, PHP_INT_MAX) for PHP versions starting with 7.0.0.
This affects the following system files:
core\Common.php
core\Security.php
helpers\captcha_helper.php
helpers\form_helper.php
helpers\string_helper.php
libraties\Upload.php
If one doesnt need support for PHP lower than 7, then its just a simple replacement otherwise a check of the PHP version would be required.
The text was updated successfully, but these errors were encountered: