Bug #24528 » 16983_v1.patch
t3lib/class.t3lib_befunc.php (working copy) | ||
---|---|---|
public static function getViewDomain($pageId, $rootLine = null) {
|
||
$domain = rtrim(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), '/');
|
||
if (!is_array($rootLine)) {
|
||
$rootLine = self::BEgetRootLine($pageId);
|
||
}
|
||
// checks alternate domains
|
||
if (count($rootLine) > 0) {
|
||
$urlParts = parse_url($domain);
|
||
if (self::getDomainStartPage($urlParts['host'], $urlParts['path'])) {
|
||
$protocol = t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://';
|
||
$domain = $protocol . self::firstDomainRecord($rootLine);
|
||
if (intval($pageId) > 0) {
|
||
if (!is_array($rootLine)) {
|
||
$rootLine = self::BEgetRootLine($pageId);
|
||
}
|
||
// checks alternate domains
|
||
if (count($rootLine) > 0) {
|
||
$urlParts = parse_url($domain);
|
||
if (self::getDomainStartPage($urlParts['host'], $urlParts['path'])) {
|
||
$protocol = t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://';
|
||
$domain = $protocol . self::firstDomainRecord($rootLine);
|
||
}
|
||
}
|
||
}
|
||
return $domain;
|