From: Mischa POSLAWSKY Date: Thu, 25 Feb 2021 13:08:27 +0000 (+0100) Subject: widget/reply: link non-image uploads instead X-Git-Tag: v5.2~3 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/9887bd21eb0d0d7211b3add639c8e92ed0d8701f widget/reply: link non-image uploads instead --- diff --git a/widget/reply.php b/widget/reply.php index 0935567..a3b8052 100644 --- a/widget/reply.php +++ b/widget/reply.php @@ -17,7 +17,14 @@ if ($_POST) { } $target .= '/' . $User->login; if ($result = userupload($_FILES['image'], $target)) { - $html .= sprintf('

', $result); + if (preg_match('(^image/)', $_FILES['image']['type'])) { + $html .= sprintf('

', $result); + } + else { + $html .= sprintf('

Bijgevoegd bestand: %s

', + $result, basename($result) + ); + } } } $query = $Db->set('comments', [