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:
Michael Kaufmann (d00p)
2015-06-11 21:00:45 +02:00
parent d0c4d5616a
commit 94f3b99ad0

View File

@@ -365,6 +365,11 @@ class Database {
$error_trace = str_replace($sql['password'], 'DB_UNPRIV_PWD', $error_trace); $error_trace = str_replace($sql['password'], 'DB_UNPRIV_PWD', $error_trace);
$error_trace = str_replace($sql_root[0]['password'], 'DB_ROOT_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 // clean up sensitive data
unset($sql); unset($sql);
unset($sql_root); unset($sql_root);