From b8c815d24593b32a6731f51a10476753f25af474 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 8 Aug 2002 18:24:53 +0000 Subject: - An attempt to solve drupal_goto() in presence of session IDs. --- includes/common.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index f032ca11a..33e9033a7 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -305,6 +305,7 @@ function drupal_goto($url) { /* ** Translate & to simply & */ + $url = str_replace ("&", "&", $url); /* @@ -313,14 +314,16 @@ function drupal_goto($url) { ** is compiled with "--enable-trans-sid". */ - if (SID == "" || strstr($url, SID)) { + $sid = session_name() . "=" . session_id(); + + if (!session_id() || strstr($url, $sid)) { header("Location: $url"); } - else if (strstr($url, "?") && !strstr($url, SID)) { - header("Location: $url&". SID); + else if (strstr($url, "?") && !strstr($url, $sid)) { + header("Location: $url&". $sid); } else { - header("Location: $url?". SID); + header("Location: $url?". $sid); } /* -- cgit v1.2.3