From: Alexander Ebert Date: Mon, 31 Dec 2012 16:39:29 +0000 (+0100) Subject: Fixed WCF::getAnchor() X-Git-Tag: 2.0.0_Beta_1~630 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6b2f5a591f0abb35ff51a37e13e085cc441723c8;p=GitHub%2FWoltLab%2FWCF.git Fixed WCF::getAnchor() Fixes #1060 --- diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 81e684e816..70b0ed763a 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -676,9 +676,14 @@ class WCF { if (!StringUtil::isASCII($path) && !StringUtil::isUTF8($path)) { $path = StringUtil::convertEncoding('ISO-8859-1', 'UTF-8', $path); } + $path = FileUtil::removeLeadingSlash($path); $baseHref = self::getTPL()->get('baseHref'); - return $baseHref . FileUtil::removeLeadingSlash($path) . '#' . $fragment; + if (!empty($path) && StringUtil::indexOf($path, '?') !== 0) { + $baseHref .= 'index.php/'; + } + + return $baseHref . $path . '#' . $fragment; } /**