Skip to content
Snippets Groups Projects
Commit 9f544e69 authored by Mads Freek Petersen's avatar Mads Freek Petersen
Browse files

Added try/catch around connecting to consent database.

PDO reveals the database password when an error occurs!


git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@530 44740490-163a-0410-bde0-09ae8108e29a
parent 2c459fbd
No related branches found
No related tags found
No related merge requests found
......@@ -37,9 +37,13 @@ class SimpleSAML_Consent_Storage {
$pdo_user = $config->getValue('consent_pdo_user');
$pdo_passwd = $config->getValue('consent_pdo_passwd');
$this->dbh = new PDO($pdo_connect, $pdo_user, $pdo_passwd,
array( PDO::ATTR_PERSISTENT => false));
try {
$this->dbh = new PDO($pdo_connect, $pdo_user, $pdo_passwd,
array( PDO::ATTR_PERSISTENT => false));
} catch(Exception $exception) {
$session = SimpleSAML_Session::getInstance(TRUE);
SimpleSAML_Utilities::fatalError($session->getTrackID(), 'PROCESSASSERTION', $exception);
}
//$this->dbh->setAttribute('PDO::ATTR_TIMEOUT', 5);
}
......
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