Added method to get the current request URI
authorMarcel Werk <burntime@woltlab.com>
Tue, 29 Jan 2013 03:17:27 +0000 (04:17 +0100)
committerMarcel Werk <burntime@woltlab.com>
Tue, 29 Jan 2013 03:17:27 +0000 (04:17 +0100)
wcfsetup/install/files/lib/system/WCF.class.php

index 03bad1d060e709ed4d7b7424374be2a5596c97e8..62f59564a853023aa2cfe8161732b82603cb3062 100644 (file)
@@ -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;
        }
        
        /**