Skip to content
Snippets Groups Projects
Commit 3241387b authored by Helmut Hummel's avatar Helmut Hummel
Browse files

[BUGIFX] Fix Redirect after switch-to-user

The compatibility layer introduced in #55809
causes trouble with the user switch feature.

User switch intentionally redirects to index.php
but the compatibility layer kicks in and redirects
back to the user module, finally leading to an
endless redirect.

This can be resolved by checking for modules which
have been changed and need that compatibility layer.

Resolves: #56364
Releases: 6.2
Change-Id: I74d8c57335af66068383b49dc7d43ea480e631b8
Reviewed-on: https://review.typo3.org/27897
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Oliver Hader
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
parent 71a7f96c
Branches
Tags
No related merge requests found
......@@ -43,13 +43,17 @@ if (!empty($_SERVER['HTTP_REFERER'])) {
$typo3RequestDir = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_DIR');
if (strpos($_SERVER['HTTP_REFERER'], $typo3RequestDir . 'mod.php') === 0) {
parse_str(substr($_SERVER['HTTP_REFERER'], strpos($_SERVER['HTTP_REFERER'], '?') + 1), $referrerParameters);
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog(
'Module ' . $referrerParameters['M'] . ' called index.php. This is deprecated since TYPO3 6.2, use' .
' BackendUtility::getModuleUrl() instead to get the target for your call.'
);
parse_str($_SERVER['QUERY_STRING'], $queryParameters);
header('Location: ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl($referrerParameters['M'], $queryParameters, FALSE, TRUE));
exit;
// As of now, only web_info and web_func have been converted and need the compatibility layer
if (!empty($referrerParameters['M']) && in_array($referrerParameters['M'], array('web_info', 'web_func'), TRUE)) {
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog(
'Module ' . $referrerParameters['M'] . ' called index.php. This is deprecated since TYPO3 6.2, use' .
' BackendUtility::getModuleUrl() instead to get the target for your call.'
);
parse_str($_SERVER['QUERY_STRING'], $queryParameters);
header('Location: ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl($referrerParameters['M'], $queryParameters, FALSE, TRUE));
exit;
}
unset($referrerParameters);
}
unset($typo3RequestDir);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment