PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar Denitz
Denitz
8 Sep 2023

Summary of Changes

random_int() is preferred over mt_rand(), see https://www.php.net/manual/en/function.mt-rand

Testing Instructions

Apply patch.

Actual result BEFORE applying this Pull Request

Usual code.

Expected result AFTER applying this Pull Request

Better code.

Link to documentations

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

1a2a191 8 Sep 2023 avatar fix
avatar joomla-cms-bot joomla-cms-bot - change - 8 Sep 2023
Category Installation Modules Front End
avatar Denitz Denitz - open - 8 Sep 2023
avatar Denitz Denitz - change - 8 Sep 2023
Status New Pending
avatar simbus82
simbus82 - comment - 11 Sep 2023

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.

avatar Denitz Denitz - change - 11 Sep 2023
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
avatar Denitz Denitz - close - 11 Sep 2023

Add a Comment

Login with GitHub to post a comment