Explicit PDO::ERRMODE_SILENT (#3408)

`PDO::ERRMODE_SILENT` is the default value
https://php.net/pdo.error-handling
We just make it explicit
#fix https://github.com/FreshRSS/FreshRSS/issues/3402
But in the issue above, it looks like it is in `PDO::ERRMODE_EXCEPTION`
mode
This commit is contained in:
Alexandre Alapetite
2021-01-30 21:53:17 +01:00
committed by GitHub
parent 0954c76866
commit 2b007ee989

View File

@@ -24,6 +24,7 @@ class Minz_ModelPdo {
private function dbConnect() {
$db = Minz_Configuration::get('system')->db;
$driver_options = isset($db['pdo_options']) && is_array($db['pdo_options']) ? $db['pdo_options'] : [];
$driver_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT;
$dbServer = parse_url('db://' . $db['host']);
$dsn = '';
$dsnParams = empty($db['connection_uri_params']) ? '' : (';' . $db['connection_uri_params']);