Reject blank posts? (just whitespace, etc).
This commit is contained in:
parent
32050c8eab
commit
ba5075ebbd
@ -67,7 +67,9 @@
|
|||||||
$config['flood_time_same'] = 30;
|
$config['flood_time_same'] = 30;
|
||||||
// Do you need a body for your non-OP posts?
|
// Do you need a body for your non-OP posts?
|
||||||
$config['force_body'] = true;
|
$config['force_body'] = true;
|
||||||
|
// Reject blank posts? (just whitespace, etc)?
|
||||||
|
$config['reject_blank'] = true;
|
||||||
|
|
||||||
// Max body length
|
// Max body length
|
||||||
$config['max_body'] = 1800;
|
$config['max_body'] = 1800;
|
||||||
|
|
||||||
|
9
post.php
9
post.php
@ -209,11 +209,16 @@
|
|||||||
$post['password'] = $_POST['password'];
|
$post['password'] = $_POST['password'];
|
||||||
$post['filename'] = get_magic_quotes_gpc() ? stripslashes($_FILES['file']['name']) : $_FILES['file']['name'];
|
$post['filename'] = get_magic_quotes_gpc() ? stripslashes($_FILES['file']['name']) : $_FILES['file']['name'];
|
||||||
$post['has_file'] = $OP || !empty($_FILES['file']['tmp_name']);
|
$post['has_file'] = $OP || !empty($_FILES['file']['tmp_name']);
|
||||||
$post['mod'] = isset($_POST['mod']) && $_POST['mod'];
|
|
||||||
|
|
||||||
if(empty($post['body']) && $config['force_body'])
|
if($config['force_body'] && empty($post['body']))
|
||||||
error($config['error']['tooshort_body']);
|
error($config['error']['tooshort_body']);
|
||||||
|
|
||||||
|
if($config['reject_blank'] && !empty($post['body'])) {
|
||||||
|
$stripped_whitespace = preg_replace('/[\s]/u', '', $post['body']);
|
||||||
|
if(empty($stripped_whitespace))
|
||||||
|
error($config['error']['tooshort_body']);
|
||||||
|
}
|
||||||
|
|
||||||
if($post['mod']) {
|
if($post['mod']) {
|
||||||
require 'inc/mod.php';
|
require 'inc/mod.php';
|
||||||
if(!$mod) {
|
if(!$mod) {
|
||||||
|
Loading…
Reference in New Issue
Block a user