require_once 'upload.inc.php';
try {
$html = messagehtml($_POST['reply']);
- if ($_FILES and isset($_FILES['image'])) {
+ if ($_FILES and !empty($_FILES['image'])) {
$target = 'data/upload';
if (!file_exists($target)) {
throw new Exception("er is geen uploadmap aanwezig op $target");
}
$target .= '/' . $User->login;
- $result = userupload($_FILES['image'], $target);
- $html .= sprintf('<p><img src="/thumb/640x/%s" /></p>', $result);
+ if ($result = userupload($_FILES['image'], $target)) {
+ $html .= sprintf('<p><img src="/thumb/640x/%s" /></p>', $result);
+ }
}
$query = $Db->set('comments', [
'page' => $Page,
print "</li>\n";
}
-if ($User) {
+if ($User->login) {
print '<li>';
print '<form method="post" action="" enctype="multipart/form-data">';
if (isset($Issue) and $User->admin("edit $Page")) {