1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-10 08:25:42 +02:00

Merge pull request #3113 from prototech/ticket/13251

[ticket/13251] Escape container parameters defined from config.php.
This commit is contained in:
Marc Alexander 2014-11-09 20:01:20 +01:00
commit 6a4cb42565

View File

@ -39,16 +39,24 @@ class config extends Extension
*/ */
public function load(array $config, ContainerBuilder $container) public function load(array $config, ContainerBuilder $container)
{ {
$container->setParameter('core.adm_relative_path', ($this->config_php->get('phpbb_adm_relative_path') ? $this->config_php->get('phpbb_adm_relative_path') : 'adm/')); $parameters = array(
$container->setParameter('core.table_prefix', $this->config_php->get('table_prefix')); 'core.adm_relative_path' => $this->config_php->get('phpbb_adm_relative_path') ? $this->config_php->get('phpbb_adm_relative_path') : 'adm/',
$container->setParameter('cache.driver.class', $this->convert_30_acm_type($this->config_php->get('acm_type'))); 'core.table_prefix' => $this->config_php->get('table_prefix'),
$container->setParameter('dbal.driver.class', $this->config_php->convert_30_dbms_to_31($this->config_php->get('dbms'))); 'cache.driver.class' => $this->convert_30_acm_type($this->config_php->get('acm_type')),
$container->setParameter('dbal.dbhost', $this->config_php->get('dbhost')); 'dbal.driver.class' => $this->config_php->convert_30_dbms_to_31($this->config_php->get('dbms')),
$container->setParameter('dbal.dbuser', $this->config_php->get('dbuser')); 'dbal.dbhost' => $this->config_php->get('dbhost'),
$container->setParameter('dbal.dbpasswd', $this->config_php->get('dbpasswd')); 'dbal.dbuser' => $this->config_php->get('dbuser'),
$container->setParameter('dbal.dbname', $this->config_php->get('dbname')); 'dbal.dbpasswd' => $this->config_php->get('dbpasswd'),
$container->setParameter('dbal.dbport', $this->config_php->get('dbport')); 'dbal.dbname' => $this->config_php->get('dbname'),
$container->setParameter('dbal.new_link', defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK); 'dbal.dbport' => $this->config_php->get('dbport'),
'dbal.new_link' => defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK,
);
$parameter_bag = $container->getParameterBag();
foreach ($parameters as $parameter => $value)
{
$container->setParameter($parameter, $parameter_bag->escapeValue($value));
}
} }
/** /**