Don't leak connection data in PDO exceptions [MAILPOET-966]

This commit is contained in:
stoletniy
2017-06-27 18:29:26 +03:00
committed by pavel-mailpoet
parent 2add301b9f
commit a4282b6a3e

View File

@@ -169,4 +169,15 @@ class Model extends \Sudzy\ValidModel {
static function getTrashed() {
return static::whereNotNull('deleted_at');
}
/**
* Rethrow PDOExceptions to prevent exposing sensitive data in stack traces
*/
public static function __callStatic($method, $parameters) {
try {
return parent::__callStatic($method, $parameters);
} catch (\PDOException $e) {
throw new \Exception($e->getMessage());
}
}
}