From 9887bd21eb0d0d7211b3add639c8e92ed0d8701f Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 25 Feb 2021 14:08:27 +0100 Subject: [PATCH] widget/reply: link non-image uploads instead --- widget/reply.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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', [ -- 2.30.0