Skip to content
Snippets Groups Projects
Unverified Commit 4633e7e2 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst Committed by GitHub
Browse files

Merge pull request #826 from happydude/db-credentials

Avoid db credentials in stack trace
parents 2218066c 0d326eb5
No related branches found
No related tags found
No related merge requests found
...@@ -57,8 +57,11 @@ class SQL extends Store ...@@ -57,8 +57,11 @@ class SQL extends Store
$password = $config->getString('store.sql.password', null); $password = $config->getString('store.sql.password', null);
$options = $config->getArray('store.sql.options', null); $options = $config->getArray('store.sql.options', null);
$this->prefix = $config->getString('store.sql.prefix', 'simpleSAMLphp'); $this->prefix = $config->getString('store.sql.prefix', 'simpleSAMLphp');
try {
$this->pdo = new \PDO($dsn, $username, $password, $options); $this->pdo = new \PDO($dsn, $username, $password, $options);
} catch (\PDOException $e) {
throw new \Exception("Database error: " . $e->getMessage());
}
$this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); $this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment