diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-01-07 01:17:27 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-01-07 01:17:27 +0100 |
commit | a8d82b7091bf80e685ca61960d5e83da26d1cbdf (patch) | |
tree | 696a6e3f9ea93615aa793dcfc8cbc76771c4ec7e /lib/private | |
parent | a014997ded070f82328bd4a1283d5adae0a9c0b6 (diff) | |
parent | 33563085948b0670b3505413c27b9cc29d663367 (diff) | |
download | nextcloud-server-a8d82b7091bf80e685ca61960d5e83da26d1cbdf.tar.gz nextcloud-server-a8d82b7091bf80e685ca61960d5e83da26d1cbdf.zip |
Merge pull request #13131 from owncloud/db-connect-stacktrace
Prevent leaking db connection info in the stacktrace
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/db/connection.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php index d10adee558c..f2fcd8730af 100644 --- a/lib/private/db/connection.php +++ b/lib/private/db/connection.php @@ -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. * |