From 362f2e0c8377a698f1b100c3352ebef2578a00c8 Mon Sep 17 00:00:00 2001 From: Gregory M Perry Date: Sun, 12 Jun 2011 22:55:10 -0700 Subject: [PATCH 1/4] 339120 Use drupal_goto so we can correctly save session state and call exit hooks, etc. --- r4032login.module | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/r4032login.module b/r4032login.module index 585b18f..16c3a07 100644 --- a/r4032login.module +++ b/r4032login.module @@ -90,12 +90,15 @@ function r4032login_redirect() { } // Check for path prefix and strip it out if its found. $path = _r4032login_remove_language(drupal_urlencode($_REQUEST['q'])); - // using drupal_goto() with destination set causes a recursive redirect loop - header('Location: '. url('user/login', array('query' => 'destination='. $path, 'absolute' => TRUE)), TRUE, 302); + // unset destination to prevent recursive redirect + unset($_REQUEST['destination']); + drupal_goto('user/login', array('destination' => $path)); exit; } elseif (!empty($redirect)) { - header('Location: '. url($redirect)); + // unset destination to prevent recursive redirect + unset($_REQUEST['destination']); + drupal_goto($redirect); exit; } // checking arg() returns r4032login -- 1.7.4.1