From 761fa7f0ea90dbbee0e22d7c187aea00e0e935b6 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 29 Jan 2013 04:17:27 +0100 Subject: [PATCH] Added method to get the current request URI --- wcfsetup/install/files/lib/system/WCF.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; } /** -- 2.20.1