Skip to content

Commit

Permalink
Merge branch 'contao3' into tng
Browse files Browse the repository at this point in the history
  • Loading branch information
discordier committed Apr 8, 2014
2 parents 491c7f7 + 0d6ee68 commit a2d89de
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -122,9 +122,11 @@ protected static function authenticateBackendUser()
return;
}

$Env->base = $Env->url . $GLOBALS['TL_CONFIG']['websitePath'] . '/';
// Fix issue #397 - the security patch rendered our redirect method non working (websitePath can now be null).
$path = constant('TL_PATH') ?: $GLOBALS['TL_CONFIG']['websitePath'];
$Env->base = $Env->url . $path . '/';
$Env->script = preg_replace(
'/^' . preg_quote($GLOBALS['TL_CONFIG']['websitePath'], '/') . '\/?/i',
'/^' . preg_quote($path, '/') . '\/?/i',
'',
$Env->scriptName
);
Expand All @@ -134,7 +136,7 @@ protected static function authenticateBackendUser()
// generate a url without replacing the basepath(TL_PATH) with an empty string.
if (!defined(TL_PATH))
{
define('TL_PATH', $GLOBALS['TL_CONFIG']['websitePath']);
define('TL_PATH', $path);
}

$objUser->authenticate();
Expand Down

0 comments on commit a2d89de

Please sign in to comment.