]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fixed #63 - le referer n'était plus pris en compte
authornicosomb <nicolas@loeuillet.org>
Sat, 20 Apr 2013 08:22:00 +0000 (10:22 +0200)
committernicosomb <nicolas@loeuillet.org>
Sat, 20 Apr 2013 08:22:00 +0000 (10:22 +0200)
index.php

index 9a81a74104f2f739fa5e059c4915bacdf923a687..954d922473808a9af4086d98a0ef81637a132cd0 100644 (file)
--- a/index.php
+++ b/index.php
@@ -20,6 +20,8 @@ if (!empty($_POST)) {
     unset($_SESSION['tokens']);
 }
 
+$ref = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
+
 if (isset($_GET['login'])) {
     // Login
     if (!empty($_POST['login']) && !empty($_POST['password'])) {
@@ -34,7 +36,7 @@ if (isset($_GET['login'])) {
             }
             session_regenerate_id(true);
 
-            MyTool::redirect();
+            MyTool::redirect($ref);
         }
         logm('login failed');
         die("Login failed !");
@@ -55,7 +57,6 @@ $action             = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['ac
 $_SESSION['sort']   = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id';
 $id                 = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : '';
 $url                = (isset ($_GET['url'])) ? $_GET['url'] : '';
-$ref                = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
 
 $tpl->assign('isLogged', Session::isLogged());
 $tpl->assign('referer', $ref);
@@ -69,4 +70,4 @@ if (Session::isLogged()) {
 }
 else {
     $tpl->draw('login');
-}
\ No newline at end of file
+}