Index: gotwo.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gotwo/gotwo.module,v retrieving revision 1.8.2.16 diff -u -r1.8.2.16 gotwo.module --- gotwo.module 20 Aug 2009 20:30:23 -0000 1.8.2.16 +++ gotwo.module 20 Aug 2009 22:38:36 -0000 @@ -144,7 +144,21 @@ return $page_content; } else { - drupal_goto($res->dst); + // Parse the URL. + $uri = parse_url($res->dst); + + $scheme = isset($uri['scheme']) ? $uri['scheme'] . '://' : ''; + $user = isset($uri['user']) ? $uri['user'] . ($uri['pass'] ? ':' . $uri['pass'] : '') . '@' : ''; + $port = isset($uri['port']) ? $uri['port'] : 80; + $host = $uri['host'] . ($port != 80 ? ':'. $port : ''); + $path = isset($uri['path']) ? $uri['path'] : '/'; + + // Glue the URL variables. + $dst_url = $scheme . $user . $host . $path; + $dst_query = isset($uri['query']) ? $uri['query'] : NULL; + $dst_fragment = isset($uri['fragment']) ? $uri['fragment'] : NULL; + + drupal_goto($dst_url, $dst_query, $dst_fragment); } } }