git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df71632
)
widget/reply: link non-image uploads instead
author
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 25 Feb 2021 13:08:27 +0000
(14:08 +0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 25 Feb 2021 13:09:18 +0000
(14:09 +0100)
widget/reply.php
patch
|
blob
|
history
diff --git
a/widget/reply.php
b/widget/reply.php
index 0935567e82ecb51ba2aeb4ff0a6717b50e313abe..a3b8052a6e7c5ad4a6794ffc6ad5b1acf07a2c3a 100644
(file)
--- a/
widget/reply.php
+++ b/
widget/reply.php
@@
-17,7
+17,14
@@
if ($_POST) {
}
$target .= '/' . $User->login;
if ($result = userupload($_FILES['image'], $target)) {
}
$target .= '/' . $User->login;
if ($result = userupload($_FILES['image'], $target)) {
- $html .= sprintf('<p><img src="/thumb/640x/%s" /></p>', $result);
+ if (preg_match('(^image/)', $_FILES['image']['type'])) {
+ $html .= sprintf('<p><img src="/thumb/640x/%s" /></p>', $result);
+ }
+ else {
+ $html .= sprintf('<p>Bijgevoegd bestand: <a href="/%s" />%s</a></p>',
+ $result, basename($result)
+ );
+ }
}
}
$query = $Db->set('comments', [
}
}
$query = $Db->set('comments', [