contact: silence warning checking missing client headers
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 20 Nov 2020 01:16:47 +0000 (02:16 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 5 Dec 2020 00:38:53 +0000 (01:38 +0100)
Same behaviour but avoiding definedness error in logs.

widget/contact.php

index b7e073fe40f72890260fcab2f448fd6ca1f3123a..a4fccda1a0ca8aead4f0b5f106653696cf05e043 100644 (file)
@@ -58,7 +58,7 @@ switch ($source) {
                'X-Accept-Language' => 'HTTP_ACCEPT_LANGUAGE',
                'User-Agent'        => 'HTTP_USER_AGENT',
        ) as $mailhdr => $serverhdr) {
-               if (!$_SERVER[$serverhdr]) continue;
+               if (empty($_SERVER[$serverhdr])) continue;
                $header .= "\r\n$mailhdr: ".$_SERVER[$serverhdr];
        }