summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-09-30 11:09:22 +0000
committerDries Buytaert <dries@buytaert.net>2001-09-30 11:09:22 +0000
commita6379d2ee80392f31691d3d8cdf8558fd34f8348 (patch)
tree643a51f40946e418ad51575c56d51a372aa1fe9f
parent8caf16cde4cebcea3534e9ff3803bef2092374b2 (diff)
downloadbrdo-a6379d2ee80392f31691d3d8cdf8558fd34f8348.tar.gz
brdo-a6379d2ee80392f31691d3d8cdf8558fd34f8348.tar.bz2
- replaced all 'header("Location: foo")'s by a call to 'drupal_goto()'
which will append the session ID to the uri 'foo' when PHP is compiled with '--enable-transe-sid'.
-rw-r--r--error.php4
-rw-r--r--includes/common.inc11
-rw-r--r--modules/queue.module2
-rw-r--r--modules/user.module6
-rw-r--r--modules/user/user.module6
5 files changed, 20 insertions, 9 deletions
diff --git a/error.php b/error.php
index db6f157c4..c4db050d0 100644
--- a/error.php
+++ b/error.php
@@ -11,10 +11,10 @@ $errors = array(500 => "500 error: internal server error",
watchdog("httpd", $errors[$REDIRECT_STATUS]);
if (strstr($REDIRECT_URL, "index.php")) {
- header("Location: ../index.php");
+ drupal_goto("../index.php");
}
else {
- header("Location: index.php");
+ drupal_goto("index.php");
}
?> \ No newline at end of file
diff --git a/includes/common.inc b/includes/common.inc
index 256beb34c..98a94b339 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -71,6 +71,17 @@ function message_throttle() {
return t("You exceeded the submission rate exceeded. Please wait a few minutes and try again.");
}
+function drupal_goto($url) {
+
+ /*
+ ** It is advised to use "drupal_goto()" instead of PHP's "header()" as
+ ** "drupal_goto()" will append the user's session ID to the URI when PHP
+ ** is compiled with "--enable-trans-sid".
+ */
+
+ header("Location: $url". SID);
+}
+
function check_form($text) {
return htmlspecialchars(stripslashes($text));
}
diff --git a/modules/queue.module b/modules/queue.module
index 3da3fcb2d..676d3fc3a 100644
--- a/modules/queue.module
+++ b/modules/queue.module
@@ -86,7 +86,7 @@ function queue_node($id) {
$node = node_get_object(array(nid => $id));
if ($user->uid == $node->author || field_get($node->users, $user->uid)) {
- header("Location: node.php?id=$node->nid");
+ drupal_goto("node.php?id=$node->nid");
}
else {
$queue_votes = array("neutral (+0)" => "+ 0", "post it (+1)" => "+ 1", "dump it (-1)" => "- 1");
diff --git a/modules/user.module b/modules/user.module
index 1ee6599b0..5e976b61e 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -482,7 +482,7 @@ function user_login($edit = array()) {
$url = $HTTP_REFERER ? $HTTP_REFERER : "module.php?mod=user&op=view";
- header("Location: $url");
+ drupal_goto($url);
}
else {
@@ -529,7 +529,7 @@ function user_logout() {
** Redirect the user to his personal information page:
*/
- header("Location: index.php");
+ drupal_goto("index.php");
}
}
@@ -688,7 +688,7 @@ function user_edit($edit = array()) {
** Redirect the user to his personal information page:
*/
- header("Location: module.php?mod=user&op=view");
+ drupal_goto("module.php?mod=user&op=view");
}
}
diff --git a/modules/user/user.module b/modules/user/user.module
index 1ee6599b0..5e976b61e 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -482,7 +482,7 @@ function user_login($edit = array()) {
$url = $HTTP_REFERER ? $HTTP_REFERER : "module.php?mod=user&op=view";
- header("Location: $url");
+ drupal_goto($url);
}
else {
@@ -529,7 +529,7 @@ function user_logout() {
** Redirect the user to his personal information page:
*/
- header("Location: index.php");
+ drupal_goto("index.php");
}
}
@@ -688,7 +688,7 @@ function user_edit($edit = array()) {
** Redirect the user to his personal information page:
*/
- header("Location: module.php?mod=user&op=view");
+ drupal_goto("module.php?mod=user&op=view");
}
}