Merge pull request #1396 from alexistoulotte/fix/use-opt-model-options-configuration

fix(configuration): Use "model_options[opt]" section from "conf.php"
This commit is contained in:
El RIDO 2024-09-03 05:50:15 +02:00 committed by GitHub
commit a85a7552c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,7 +12,6 @@
namespace PrivateBin; namespace PrivateBin;
use Exception; use Exception;
use PDO;
/** /**
* Configuration * Configuration
@ -166,7 +165,7 @@ class Configuration
'tbl' => null, 'tbl' => null,
'usr' => null, 'usr' => null,
'pwd' => null, 'pwd' => null,
'opt' => array(PDO::ATTR_PERSISTENT => true), 'opt' => array(),
); );
} elseif ( } elseif (
$section == 'model_options' && in_array( $section == 'model_options' && in_array(
@ -235,6 +234,8 @@ class Configuration
$result = (int) $config[$section][$key]; $result = (int) $config[$section][$key];
} elseif (is_string($val) && !empty($config[$section][$key])) { } elseif (is_string($val) && !empty($config[$section][$key])) {
$result = (string) $config[$section][$key]; $result = (string) $config[$section][$key];
} elseif (is_array($val) && is_array($config[$section][$key])) {
$result = $config[$section][$key];
} }
} }
$this->_configuration[$section][$key] = $result; $this->_configuration[$section][$key] = $result;