@@ -, +, @@
http://nedbatchelder.com/text/stopbots.html
https://github.com/subwindow/negative-captcha
http://www.rubydoc.info/github/subwindow/negative-captcha/frames
adding the suggestion should succeed
replace line 130, from...
to ...
adding the suggestion should fail
---
koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt | 7 +++++++
opac/opac-suggestions.pl | 8 ++++++++
2 files changed, 15 insertions(+)
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt
+++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt
@@ -21,6 +21,7 @@
}[% END %]
$(function() {
+
$("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
"aaSorting": [[ 1, "asc" ]],
"aoColumnDefs": [
@@ -124,6 +125,12 @@
[% END %][% END %]
+
+
+
+ negcap
+
+
--- a/opac/opac-suggestions.pl
+++ a/opac/opac-suggestions.pl
@@ -33,6 +33,14 @@ my $input = new CGI;
my $allsuggestions = $input->param('showall');
my $op = $input->param('op');
my $suggestion = $input->Vars;
+my $negcaptcha = $input->param('negcap');
+
+# BZ 3144 - if a spambot accidentally populates the 'negcap' field in the sugesstions form, then silently skip and return.
+if ($negcaptcha ) {
+ print $input->redirect("/cgi-bin/koha/opac-suggestions.pl");
+ exit;
+}
+
delete $$suggestion{$_} foreach qw;
$op = 'else' unless $op;
--