Skip to content

Commit

Permalink
Set config values from current request
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Apr 8, 2020
1 parent c1f2f93 commit 39d987b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core-bundle/src/Resources/contao/library/Contao/Config.php
Expand Up @@ -489,6 +489,15 @@ protected static function loadParameters()
}
}

$objRequest = $container->get('request_stack')->getCurrentRequest();

/** @var PageModel $objPage */
if (null !== $objRequest && ($objPage = $objRequest->attributes->get('pageModel')) instanceof PageModel)
{
$GLOBALS['TL_CONFIG']['addLanguageToUrl'] = $objPage->languagePrefix !== '';
$GLOBALS['TL_CONFIG']['urlSuffix'] = $objPage->urlSuffix;
}

if ($container->hasParameter('contao.image.valid_extensions'))
{
$GLOBALS['TL_CONFIG']['validImageTypes'] = implode(',', $container->getParameter('contao.image.valid_extensions'));
Expand Down

0 comments on commit 39d987b

Please sign in to comment.