From: Marcel Werk Date: Tue, 29 Jan 2013 03:17:27 +0000 (+0100) Subject: Added method to get the current request URI X-Git-Tag: 2.0.0_Beta_1~532 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=761fa7f0ea90dbbee0e22d7c187aea00e0e935b6;p=GitHub%2FWoltLab%2FWCF.git Added method to get the current request URI --- diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 03bad1d060..62f59564a8 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -666,6 +666,15 @@ class WCF { * @return string */ public function getAnchor($fragment) { + return $this->getRequestURI() . '#' . $fragment; + } + + /** + * Returns the URI of the current page. + * + * @return string + */ + public function getRequestURI() { // resolve path and query components $scriptName = $_SERVER['SCRIPT_NAME']; if (empty($_SERVER['PATH_INFO'])) { @@ -684,7 +693,7 @@ class WCF { $baseHref .= 'index.php/'; } - return $baseHref . $path . '#' . $fragment; + return $baseHref . $path; } /**