Bug #81720 ยป fix_location_header_url.patch
typo3/sysext/core/Classes/Utility/GeneralUtility.php | ||
---|---|---|
* Prefixes a URL used with 'header-location' with 'http://...' depending on whether it has it already.
|
||
* - If already having a scheme, nothing is prepended
|
||
* - If having REQUEST_URI slash '/', then prefixing 'http://[host]' (relative to host)
|
||
* - If having double slash '//' (PRURL), then prefixing 'http:' (relative to protocol)
|
||
* - Otherwise prefixed with TYPO3_REQUEST_DIR (relative to current dir / TYPO3_REQUEST_DIR)
|
||
*
|
||
* @param string $path URL / path to prepend full URL addressing to.
|
||
... | ... | |
$uI = parse_url($path);
|
||
// relative to HOST
|
||
if ($path[0] === '/') {
|
||
$path = self::getIndpEnv('TYPO3_REQUEST_HOST') . $path;
|
||
if ($uI['host']) {
|
||
$path = (self::getIndpEnv('TYPO3_SSL') ? 'https:' : 'http:') . $path;
|
||
} else {
|
||
$path = self::getIndpEnv('TYPO3_REQUEST_HOST') . $path;
|
||
}
|
||
} elseif (!$uI['scheme']) {
|
||
// No scheme either
|
||
$path = self::getIndpEnv('TYPO3_REQUEST_DIR') . $path;
|