login: forward redirect parameters on post form
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 12 Jun 2019 18:49:28 +0000 (20:49 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 12 Jun 2019 22:37:34 +0000 (00:37 +0200)
Copy as explicit post field since get parameters are stripped since commit
v3.5-30-g1a94d9191a (2018-08-11) [strip logout parameter on form post].

Reported-by: Ben van Vianen
login/form.inc.php
login/index.php

index c3913fbd319ca501ff927a30ccd279bc9d152db9..7e78f8201cd988d55674e004b88944c94f8a8930 100644 (file)
@@ -1,6 +1,7 @@
 <h2>Inloggen</h2>
 
 <form action="?" method="post">
+       <input type="hidden" name="goto" value="<?php print htmlspecialchars(@$_REQUEST['goto']); ?>" />
        <input id="login" name="login" placeholder="Gebruikersnaam" value="<?php
                if (isset($_POST['login'])) print htmlspecialchars($_POST['login']);
        ?>" />
index 86af0744a4587ea1d9aeab162384a34cb5371641..8b4c223914bf31d8befcf26a814d75ca7db80e2c 100644 (file)
@@ -42,9 +42,9 @@ if (empty($User)) {
        return TRUE;
 }
 
-if (isset($_GET['goto'])) {
+if (isset($_REQUEST['goto'])) {
        ob_clean();
-       $target = ltrim($_GET['goto'], '/');
+       $target = ltrim($_REQUEST['goto'], '/');
        header("Location: /$target");
        http_response_code(302);
        exit;