User tests: Successful: Unsuccessful:
random_int() is preferred over mt_rand(), see https://www.php.net/manual/en/function.mt-rand
Apply patch.
Usual code.
Better code.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Category | ⇒ | Installation Modules Front End |
Status | New | ⇒ | Pending |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-09-11 09:44:34 |
Closed_By | ⇒ | Denitz | |
Labels |
Added:
PR-5.0-dev
|
It Is preferred... in what case?
random_int is far slower than mt_rand()/rand(). It should only be used where cryptographically security is needed.
I don't think you need this kind of security during the generation of root ID during installation, or in the plugin function that chooses a random image.