diff --git a/inc/config.php b/inc/config.php index d589f203..8306d8cb 100644 --- a/inc/config.php +++ b/inc/config.php @@ -489,6 +489,8 @@ $config['force_body_op'] = true; // Require an image for threads? $config['force_image_op'] = true; + // Require a subject for threads? + $config['force_subject_op'] = false; // Strip superfluous new lines at the end of a post. $config['strip_superfluous_returns'] = true; @@ -1232,6 +1234,7 @@ $config['error']['tooshort_body_op'] = _('OP must be at least %d characters long.'); $config['error']['no_body'] = _('The body was too short or empty.'); $config['error']['noimage'] = _('You must upload an image.'); + $config['error']['nosubject'] = _('You must add a subject.'); $config['error']['toomanyimages'] = _('You have attempted to upload too many images!'); $config['error']['nomove'] = _('The server failed to handle your upload.'); $config['error']['fileext'] = _('Unsupported image format.'); diff --git a/post.php b/post.php index ce269b03..d82646d2 100644 --- a/post.php +++ b/post.php @@ -641,7 +641,11 @@ if (isset($_POST['delete'])) { error($config['error']['no_body']); } } - + + if ($post['op'] && $config['force_subject_op'] && $post['subject'] == '') { + error($config['error']['nosubject']); + } + if (!$post['op']) { // Check if thread is locked // but allow mods to post