From: Mischa POSLAWSKY Date: Mon, 25 Jan 2021 23:13:59 +0000 (+0100) Subject: widget/contact: reduce code indentation of post check X-Git-Tag: v5.2~7 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/e7a8a9311f482c787aa98a9ee5ef8f693f9832ac widget/contact: reduce code indentation of post check Minor code cleanup. --- diff --git a/widget/contact.php b/widget/contact.php index 6ccb79a..b2d41cb 100644 --- a/widget/contact.php +++ b/widget/contact.php @@ -1,18 +1,20 @@ login) { - $_REQUEST['login'] = $User->login; - $_REQUEST['email'] = $_REQUEST['email'] ?: $User->email; - } - else { - unset($_REQUEST['login']); - } - $error = mailform($_REQUEST, $Page->place); - if (!empty($error)) { - print "

$error

\n\n"; - } +global $User; +if ($User->login) { + $_REQUEST['login'] = $User->login; + $_REQUEST['email'] = $_REQUEST['email'] ?: $User->email; +} +else { + unset($_REQUEST['login']); +} +$error = mailform($_REQUEST, $Page->place); +if (!empty($error)) { + print "

$error

\n\n"; } function mailform($input = [], $config = [])