--- singlesignon_controller.module.orig	2009-10-01 00:26:47.000000000 +0530
+++ singlesignon_controller.module	2010-05-24 01:07:43.000000000 +0530
@@ -75,8 +75,18 @@
     return;
   }
   else {
+    $origin = $_GET['origin'];
+    $parsed = parse_url($origin);
+    $arguments = explode('&', $parsed['query']);
+    // Process the destination argument if it is the only argument.
+    if (count($arguments) == 1) {
+      $argument = explode('=', $arguments[0]);
+      if ($argument[0] == 'destination') {
+        $origin = $parsed['scheme'] .'://'. $parsed['host'] .'/'. $argument[1];
+      }  
+    }
     // Redirect to given origin.
-    $form_state['redirect'] = $_GET['origin'];
+    $form_state['redirect'] = $origin;
   }
 }
 
