From 0ec90fd7bb857d3986fdd91b3b74edb4931107d1 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 30 Dec 2010 20:12:57 +0100 Subject: add simple botfiltering Bots tend to fill out all fields, so add a hidden "email" field that will prevent the text from being saved. Signed-off-by: Florian Pritz --- system/application/controllers/file.php | 3 +++ system/application/views/file/upload_form.php | 1 + 2 files changed, 4 insertions(+) diff --git a/system/application/controllers/file.php b/system/application/controllers/file.php index e42d1d3db..4fed02599 100644 --- a/system/application/controllers/file.php +++ b/system/application/controllers/file.php @@ -129,6 +129,9 @@ class File extends Controller { $data = array(); $content = $this->input->post('content')."\n"; $extension = $this->input->post('extension'); + // Try to filter spambots + if ($this->input->post("email") != "") return; + // prevent empty pastes from the upload form if($content === "\n") { $this->upload_form(); diff --git a/system/application/views/file/upload_form.php b/system/application/views/file/upload_form.php index fe3f5db5a..0f90bab0e 100644 --- a/system/application/views/file/upload_form.php +++ b/system/application/views/file/upload_form.php @@ -10,6 +10,7 @@


+

Email:
Optional password (for deletion):

-- cgit v1.2.3-24-g4f1b