(Edit: I've referenced 8.00.22 because it's the newest code on Github, but as far as I can tell, the bug is present in both .21 and .22)
The errorThe MySQLi and PDO database handlers both have a function like this:
mysqli_functions_include.php #L139 - #L145dbconnection() is currently called only one place outside of the handlers themselves:
maincore.php #L1136function_get_settings() is however very dependant on the dbconnection() static variable being initialized. In pdo_functions_include.php, it is. In mysqli_functions_include.php, it is not - and as such, it will never return a connection.
pdo_functions_include.php #L152mysqli_functions_include.php #L126My solutionWrapping the connection in dbconnection() as follows
solved the two bugs that made me go hunting in the first place. I have not tested every place function_get_settings() is in use - I'll let you decide if that is needed.
Impact(image) A quick command line search for function_get_settings() in 8.00.22A lot of these places doesn't matter because of luck, but some do. I've found two, but they're probably not alone.
administration/bbcodes.php, before:
and after:
maintenance.php: Without the fix, it redirects to itself forever