X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/9887bd21eb0d0d7211b3add639c8e92ed0d8701f..72aa68cdc990dde3d67b9c8827cd794e4c447968:/widget/reply.php diff --git a/widget/reply.php b/widget/reply.php index a3b8052..685a611 100644 --- a/widget/reply.php +++ b/widget/reply.php @@ -4,12 +4,17 @@ require_once 'database.inc.php'; $journalcol = [ 'assign' => 'Toegewezen aan', + 'subject' => 'Onderwerp', ]; if ($_POST) { require_once 'upload.inc.php'; try { - $html = messagehtml($_POST['reply']); + $reply = []; + if (isset($_POST['reply']) and $body = $_POST['reply']) { + $reply['raw'] = $body; + $reply['message'] = messagehtml($body); + } if ($_FILES and !empty($_FILES['image'])) { $target = 'data/upload'; if (!file_exists($target)) { @@ -17,19 +22,19 @@ if ($_POST) { } $target .= '/' . $User->login; if ($result = userupload($_FILES['image'], $target)) { + $reply['raw'] .= "/$result"; if (preg_match('(^image/)', $_FILES['image']['type'])) { - $html .= sprintf('
\n%s\n", $row->message); + if ($html = $row->message) { + $html = preg_replace('/(?<=
\n%s\n", $html); + } if ($changes = json_decode($row->journal)) { print '