do not show error-trace / sensitive data when db-server is down or login credentials are wrong
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -365,6 +365,11 @@ class Database {
|
||||
$error_trace = str_replace($sql['password'], 'DB_UNPRIV_PWD', $error_trace);
|
||||
$error_trace = str_replace($sql_root[0]['password'], 'DB_ROOT_PWD', $error_trace);
|
||||
|
||||
if ($error->getCode() == 2003) {
|
||||
$error_message = "Unable to connect to database. Either the mysql-server is not running or your user/password is wrong.";
|
||||
$error_trace = "";
|
||||
}
|
||||
|
||||
// clean up sensitive data
|
||||
unset($sql);
|
||||
unset($sql_root);
|
||||
|
||||
Reference in New Issue
Block a user