Skip to content

Commit

Permalink
Fix a potential null pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Feb 19, 2019
1 parent 95a116f commit f5bd0b0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core-bundle/src/Resources/contao/controllers/BackendMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,13 @@ protected function output()
$this->Template->manager = (strpos($objSession->get('filePickerRef'), 'contao/page?') !== false) ? $GLOBALS['TL_LANG']['MSC']['pagePickerHome'] : $GLOBALS['TL_LANG']['MSC']['filePickerHome'];
}

$referer = null;

if ($request = $container->get('request_stack')->getCurrentRequest())
{
$referer = base64_encode($request->getQueryString());
}

$this->Template->theme = Backend::getTheme();
$this->Template->base = Environment::get('base');
$this->Template->language = $GLOBALS['TL_LANGUAGE'];
Expand All @@ -288,7 +295,7 @@ protected function output()
$this->Template->canDebug = $this->User->isAdmin;
$this->Template->isDebug = $container->get('kernel')->isDebug();
$this->Template->debug = $container->get('kernel')->isDebug() ? $GLOBALS['TL_LANG']['MSC']['disableDebugMode'] : $GLOBALS['TL_LANG']['MSC']['enableDebugMode'];
$this->Template->referer = base64_encode($container->get('request_stack')->getCurrentRequest()->getQueryString());
$this->Template->referer = $referer;
$this->Template->profileTitle = StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['profileTitle']);
$this->Template->security = $GLOBALS['TL_LANG']['MSC']['security'];
$this->Template->pageOffset = (int) Input::cookie('BE_PAGE_OFFSET');
Expand Down

0 comments on commit f5bd0b0

Please sign in to comment.