Merge pull request #13131 from owncloud/db-connect-stacktrace

Prevent leaking db connection info in the stacktrace
This commit is contained in:
Morris Jobke 2015-01-07 01:17:27 +01:00
commit a8d82b7091
1 changed files with 10 additions and 0 deletions

View File

@ -7,6 +7,7 @@
*/
namespace OC\DB;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Cache\QueryCacheProfile;
@ -24,6 +25,15 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection {
*/
protected $adapter;
public function connect() {
try {
return parent::connect();
} catch (DBALException $e) {
// throw a new exception to prevent leaking info from the stacktrace
throw new DBALException($e->getMessage(), $e->getCode());
}
}
/**
* Initializes a new instance of the Connection class.
*