X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/2d7b510a9d33a552b024e1db00212658f21afce6..fc1eaa7b91bd44d7939c67b1d3d8aef50af3c5db:/upload.inc.php
diff --git a/upload.inc.php b/upload.inc.php
index 77fa846..22db140 100644
--- a/upload.inc.php
+++ b/upload.inc.php
@@ -63,6 +63,7 @@ function messagehtml($input)
'{<([^>\s|]+)[\s|]([^>]+)>}' => '$2', # hyperlink
"/\r\n?/" => "\n", # unix newlines
"/ +\n/" => "
", # trailing spaces for hard line break
+ '{^(/data/.*\.jpe?g)\z}m' => '', # image reference
"/^[-*] (.*)$\n?/m" => '
$1', # list item
"/^(.+)$\n?/m" => "$1
\n", # paragraph
"{^(
.*)(?:\n)?}m" => "\n", # list container
@@ -84,9 +85,6 @@ function createcomment($input, &$Issue = NULL)
$reply['raw'] = $body;
$reply['message'] = messagehtml($body);
}
- if (isset($input['announce'])) {
- $reply['announced'] = !!$input['announce'];
- }
if ($_FILES and !empty($_FILES['image'])) {
$target = 'data/upload';
if (!file_exists($target)) {
@@ -107,6 +105,15 @@ function createcomment($input, &$Issue = NULL)
}
}
}
+ if (!$reply) {
+ throw new Exception("lege inhoud");
+ }
+ if (isset($input['announce'])) {
+ $reply['announced'] = !!$input['announce'];
+ }
+ if (isset($input['page'])) {
+ $reply['page'] = $input['page'];
+ }
if (isset($input['id'])) {
$newcomment = $input['id'];