diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2011-02-22 11:09:43 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2011-02-22 11:09:43 +1100 |
| commit | ba5075ebbd7611a5d539755a6402d825090a6bda (patch) | |
| tree | 5b2a03204562ce6f20504dbd783861518537cff5 /post.php | |
| parent | 32050c8eab8c626b687122b88fd650f15c997710 (diff) | |
Reject blank posts? (just whitespace, etc).
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -209,11 +209,16 @@ $post['password'] = $_POST['password']; $post['filename'] = get_magic_quotes_gpc() ? stripslashes($_FILES['file']['name']) : $_FILES['file']['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']); + 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']) { require 'inc/mod.php'; if(!$mod) { |
