From 98cb0f179206843ceaa87df6bfb3d1da045ed8ad Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sat, 29 Jan 2011 09:55:12 -0500
Subject: [PATCH] Apply bug fixes and localization updated from trunk for release 0.5.1

---
 index.php |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/index.php b/index.php
index d44e13b..89066b5 100644
--- a/index.php
+++ b/index.php
@@ -2,9 +2,9 @@
 /*
  +-------------------------------------------------------------------------+
  | Roundcube Webmail IMAP Client                                           |
- | Version 0.5                                                             |
+ | Version 0.5.1                                                           |
  |                                                                         |
- | Copyright (C) 2005-2010, Roundcube Dev. - Switzerland                   |
+ | Copyright (C) 2005-2011, Roundcube Dev. - Switzerland                   |
  |                                                                         |
  | This program is free software; you can redistribute it and/or modify    |
  | it under the terms of the GNU General Public License version 2          |
@@ -104,12 +104,17 @@
     rcmail_log_login();
 
     // restore original request parameters
-    $query = array('_task' => 'mail');
-    if ($url = get_input_value('_url', RCUBE_INPUT_POST))
+    $query = array();
+    if ($url = get_input_value('_url', RCUBE_INPUT_POST)) {
       parse_str($url, $query);
+      
+      // prevent endless looping on login page
+      if ($query['_task'] == 'login')
+        unset($query['_task']);
+    }
 
     // allow plugins to control the redirect url after login success
-    $redir = $RCMAIL->plugins->exec_hook('login_after', $query);
+    $redir = $RCMAIL->plugins->exec_hook('login_after', $query + array('_task' => 'mail'));
     unset($redir['abort']);
 
     // send redirect

--
Gitblit v1.9.1