Added 'appendSession' parameter to LinkHandler
authorAlexander Ebert <ebert@woltlab.com>
Wed, 7 Nov 2012 17:48:12 +0000 (18:48 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 7 Nov 2012 17:48:12 +0000 (18:48 +0100)
Whenever you're providing a permanent-link to an object, set appendSession to "false" as it suppresses the session id.

wcfsetup/install/files/lib/system/request/LinkHandler.class.php

index fa3b8ed0f4667c62abfc2922a36d60cbaa62e34e..5fd5d7258f1203e0b47c37668030db788ff5f1f7 100644 (file)
@@ -27,6 +27,7 @@ class LinkHandler extends SingletonFactory {
                $abbreviation = 'wcf';
                $anchor = '';
                $isRaw = false;
+               $appendSession = true;
                if (isset($parameters['application'])) {
                        $abbreviation = $parameters['application'];
                        unset($parameters['application']);
@@ -35,6 +36,10 @@ class LinkHandler extends SingletonFactory {
                        $isRaw = $parameters['isRaw'];
                        unset($parameters['isRaw']);
                }
+               if (isset($parameters['appendSession'])) {
+                       $appendSession = $parameters['appendSession'];
+                       unset($parameters['appendSession']);
+               }
                
                // remove anchor before parsing
                if (($pos = strpos($url, '#')) !== false) {
@@ -72,7 +77,9 @@ class LinkHandler extends SingletonFactory {
                }
                
                // append session id
-               $url .= (strpos($url, '?') === false) ? SID_ARG_1ST : SID_ARG_2ND_NOT_ENCODED;
+               if ($appendSession) {
+                       $url .= (strpos($url, '?') === false) ? SID_ARG_1ST : SID_ARG_2ND_NOT_ENCODED;
+               }
                
                // handle application groups
                $applicationGroup = ApplicationHandler::getInstance()->getActiveGroup();