issue: require message contents
[minimedit.git] / upload.inc.php
index 77fa846aebd59057df1dd9c7caf7445d17a3ef0e..f2e101a3a9faa4d412eb28c0e42d3778a30ea076 100644 (file)
@@ -84,9 +84,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 +104,12 @@ function createcomment($input, &$Issue = NULL)
                        }
                }
        }
+       if (!$reply) {
+               throw new Exception("lege inhoud");
+       }
+       if (isset($input['announce'])) {
+               $reply['announced'] = !!$input['announce'];
+       }
 
        if (isset($input['id'])) {
                $newcomment = $input['id'];