X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/e64861a7760cfe34596e193a6a3ed2ef39b25892..2effc7e15fb4b6203d5479a215dfb246d8f52826:/widget/reply.php?ds=inline diff --git a/widget/reply.php b/widget/reply.php index 1f6d0e2..0a0e4e5 100644 --- a/widget/reply.php +++ b/widget/reply.php @@ -4,6 +4,7 @@ require_once 'database.inc.php'; $journalcol = [ 'assign' => 'Toegewezen aan', + 'subject' => 'Onderwerp', ]; if ($_POST) { @@ -17,7 +18,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', [ @@ -61,9 +69,8 @@ if ($_POST) { } } - if ($Page->api) { - abort("/{$Page->link}", '200 reply success'); - } + $target = "/{$Page->link}/$newcomment#$newcomment"; + abort($target, ($Page->api ? 200 : 303) . ' reply success'); $_POST['reply'] = NULL; } catch (Exception $e) { @@ -81,7 +88,7 @@ print '