if ($_POST and isset($_POST['subject'])) {
require_once 'upload.inc.php';
if (strlen($_POST['subject']) < 2) {
- throw new Exception('Een minimaal onderwerp is verplicht om een issue aan te maken.');
+ throw new Exception('Vul een onderwerp in om de issue te kunnen benoemen.');
+ }
+ if (!preg_match('/\S/', $_POST['reply'])) {
+ throw new Exception('Een korte beschrijving is verplicht om een issue aan te maken.');
}
$query = $Db->set('issues', [
'page' => $Page->handler,
$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)) {
}
}
}
+ if (!$reply) {
+ throw new Exception("lege inhoud");
+ }
+ if (isset($input['announce'])) {
+ $reply['announced'] = !!$input['announce'];
+ }
if (isset($input['id'])) {
$newcomment = $input['id'];