Don't leak connection data in PDO exceptions [MAILPOET-966]
This commit is contained in:
committed by
pavel-mailpoet
parent
2add301b9f
commit
a4282b6a3e
@@ -169,4 +169,15 @@ class Model extends \Sudzy\ValidModel {
|
|||||||
static function getTrashed() {
|
static function getTrashed() {
|
||||||
return static::whereNotNull('deleted_at');
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user