From 782f3fea0eb5322193dbcf16c410f90422c64cae Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 12 Oct 2011 19:09:32 +0200 Subject: [PATCH] base-href is not set on runtime --- wcfsetup/install/files/acp/templates/header.tpl | 1 + wcfsetup/install/files/lib/system/WCFACP.class.php | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/wcfsetup/install/files/acp/templates/header.tpl b/wcfsetup/install/files/acp/templates/header.tpl index f062abc097..881bafa104 100644 --- a/wcfsetup/install/files/acp/templates/header.tpl +++ b/wcfsetup/install/files/acp/templates/header.tpl @@ -1,6 +1,7 @@ + {if $pageTitle|isset}{@$pageTitle}{else}{lang}wcf.global.pageTitle{/lang}{/if} - {lang}wcf.acp{/lang} diff --git a/wcfsetup/install/files/lib/system/WCFACP.class.php b/wcfsetup/install/files/lib/system/WCFACP.class.php index 938b2d627b..a2dbd8df47 100644 --- a/wcfsetup/install/files/lib/system/WCFACP.class.php +++ b/wcfsetup/install/files/lib/system/WCFACP.class.php @@ -85,7 +85,19 @@ class WCFACP extends WCF { protected function assignDefaultTemplateVariables() { parent::assignDefaultTemplateVariables(); + // base tag is determined on runtime + $phpSelf = $_SERVER['PHP_SELF']; + if (isset($_SERVER['PATH_INFO'])) { + // strip path info + $phpSelf = str_replace($_SERVER['PATH_INFO'], '', $phpSelf); + } + if (($pos = strpos($phpSelf, 'index.php')) !== false) { + // strip index.php + $phpSelf = substr($phpSelf, 0, $pos); + } + self::getTPL()->assign(array( + 'baseHref' => $phpSelf, 'quickAccessPackages' => $this->getQuickAccessPackages(), //'timezone' => util\DateUtil::getTimezone() )); -- 2.20.1