MantisBT: master 1791605e

Author Committer Branch Timestamp Parent
dregad dregad master 2024-02-11 06:03 master 309f35bd
Affected Issues  0033631: Uncaught exception in installer
Changeset

Installer: catch RandomException

When the installer attempts to generate the Crypto Master Salt, if there
is no available randomness source, random_bytes() throws an exception
which was not caught, disrupting the installation procedure.

Refactoring the code to catch the exception, and display a meaningful
warning message to the admin, and add a comment in the generated config
file.

Note: it's a RandomException on PHP 8.2+, and plain Exception in older
PHP versions, so we catch the latter for now to ensure compatibility.

Fixes 33631

mod - admin/install.php Diff File