"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core-bundle/src/Resources/contao/classes/Frontend.php" between
contao-4.9.11.tar.gz and contao-4.9.12.tar.gz

About: Contao (fka TYPOlight) is a content management system (CMS). Long-term support (LTS).

Frontend.php  (contao-4.9.11):Frontend.php  (contao-4.9.12)
skipping to change at line 335 skipping to change at line 335
// Always load the language fall back root if "doNotRedir ectEmpty" is enabled // Always load the language fall back root if "doNotRedir ectEmpty" is enabled
if (Config::get('addLanguageToUrl') && Config::get('doNot RedirectEmpty')) if (Config::get('addLanguageToUrl') && Config::get('doNot RedirectEmpty'))
{ {
$accept_language = '-'; $accept_language = '-';
} }
$strUri = Environment::get('url') . '/'; $strUri = Environment::get('url') . '/';
$strError = 'No root page found (host "' . Environment::g et('host') . '", languages "' . implode(', ', Environment::get('httpAcceptLangua ge')) . '")'; $strError = 'No root page found (host "' . Environment::g et('host') . '", languages "' . implode(', ', Environment::get('httpAcceptLangua ge')) . '")';
} }
$objRequest = Request::create($strUri);
$objRequest->headers->set('Accept-Language', $accept_language);
try try
{ {
$objRequest = Request::create($strUri);
$objRequest->headers->set('Accept-Language', $accept_lang
uage);
$arrParameters = System::getContainer()->get('contao.rout ing.nested_matcher')->matchRequest($objRequest); $arrParameters = System::getContainer()->get('contao.rout ing.nested_matcher')->matchRequest($objRequest);
$objRootPage = $arrParameters['pageModel'] ?? null;
if (!$objRootPage instanceof PageModel)
{
throw new MissingMandatoryParametersException('Ev
ery Contao route must have a "pageModel" parameter');
}
} }
catch (RoutingExceptionInterface $exception) catch (RoutingExceptionInterface $exception)
{ {
$logger->log(LogLevel::ERROR, $strError, array('contao' = try
> new ContaoContext(__METHOD__, 'ERROR'))); {
$arrParameters = System::getContainer()->get('con
tao.routing.nested_404_matcher')->matchRequest($objRequest);
}
catch (RoutingExceptionInterface $exception)
{
$logger->log(LogLevel::ERROR, $strError, array('c
ontao' => new ContaoContext(__METHOD__, 'ERROR')));
throw new NoRootPageFoundException('No root page
found', 0, $exception);
}
}
$objRootPage = $arrParameters['pageModel'] ?? null;
throw new NoRootPageFoundException('No root page found', if (!$objRootPage instanceof PageModel)
0, $exception); {
throw new MissingMandatoryParametersException('Every Cont
ao route must have a "pageModel" parameter');
} }
// Redirect to the website root or language root (e.g. en/) // Redirect to the website root or language root (e.g. en/)
if (!Environment::get('relativeRequest')) if (!Environment::get('relativeRequest'))
{ {
if (Config::get('addLanguageToUrl') && !Config::get('doNo tRedirectEmpty')) if (Config::get('addLanguageToUrl') && !Config::get('doNo tRedirectEmpty'))
{ {
$arrParams = array('_locale' => $objRootPage->lan guage); $arrParams = array('_locale' => $objRootPage->lan guage);
$strUrl = System::getContainer()->get('router')-> generate('contao_index', $arrParams); $strUrl = System::getContainer()->get('router')-> generate('contao_index', $arrParams);
 End of changes. 5 change blocks. 
15 lines changed or deleted 23 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)