From 84925d852d34ac9c6fcc2c3c5e749b8bd70bc22d Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 20 May 2001 20:58:55 +0000 Subject: Moved the append_sid routine to the sessions.php file git-svn-id: file:///svn/phpbb/trunk@317 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/sessions.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'phpBB/includes/sessions.php') diff --git a/phpBB/includes/sessions.php b/phpBB/includes/sessions.php index 72f3d4fad6..c22abf1aad 100644 --- a/phpBB/includes/sessions.php +++ b/phpBB/includes/sessions.php @@ -463,4 +463,27 @@ function session_end($session_id, $user_id) } // session_end() +// +// Append $SID to a url +// Borrowed from phplib and modified. This is an +// extra routine utilised by the session +// code above and acts as a wrapper +// around every single URL and form action. If +// you replace the session code you must +// include this routine, even if it's empty. +// +function append_sid($url) +{ + global $SID; + + if(!empty($SID) && !eregi("^http:", $url) && !eregi("sid=", $url)) + { + $url = ereg_replace("[&?]+$", "", $url); + $url .= ( (strpos($url, "?") != false) ? "&" : "?" ) . $SID; + } + + return($url); + +} + ?> \ No newline at end of file -- cgit v1.2.1