widget/contact: current user overrides login, email fallback
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 4 Nov 2019 23:20:54 +0000 (00:20 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 4 Nov 2019 23:20:54 +0000 (00:20 +0100)
widget/contact.php

index b50537517d7b68952f50922a53c244b7763e8e91..ed0a0828140c7f875a7271d98075b31155b678a3 100644 (file)
@@ -4,6 +4,10 @@ if ($_POST) {
        global $User;
        if ($User) {
                $_REQUEST['login'] = $User->login;
+               $_REQUEST['email'] = $_REQUEST['email'] ?: $User->email;
+       }
+       else {
+               unset($_REQUEST['login']);
        }
        $error = mailform($_REQUEST);
        if (!empty($error)) {