summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-09-07 02:13:48 +0200
committerYorhel <git@yorhel.nl>2015-09-07 02:13:48 +0200
commitf6dcfd8fcf094bd0872fb491135c58ce50f0674b (patch)
treee111716ac654e14bf837569ab1bf19bee7b6376c /lib
parent438d4df64d950f8905bd31bddc203d408f42f125 (diff)
Handler::Discussions: Remove formcode from search form
It's not verified and only uglifies the URLs.
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/Discussions.pm2
-rw-r--r--lib/VNDB/Util/FormHTML.pm9
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm
index d416d26b..27548baf 100644
--- a/lib/VNDB/Handler/Discussions.pm
+++ b/lib/VNDB/Handler/Discussions.pm
@@ -387,7 +387,7 @@ sub search {
return $self->resNotFound if $frm->{_err};
$self->htmlHeader(title => mt('_dissearch_title'), noindex => 1);
- $self->htmlForm({ frm => $frm, action => '/t/search', method => 'get', nosubmit => 1 }, 'boardsearch' => [mt('_dissearch_title'),
+ $self->htmlForm({ frm => $frm, action => '/t/search', method => 'get', nosubmit => 1, noformcode => 1 }, 'boardsearch' => [mt('_dissearch_title'),
[ input => short => 'bq', name => mt('_dissearch_query') ],
[ check => short => 't', name => mt('_dissearch_titleonly') ],
[ select => short => 'b', name => mt('_dissearch_boards'), multi => 1, size => scalar @{$self->{discussion_boards}},
diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm
index 041d5a14..b994792e 100644
--- a/lib/VNDB/Util/FormHTML.pm
+++ b/lib/VNDB/Util/FormHTML.pm
@@ -173,6 +173,7 @@ sub htmlFormPart {
# nosubmit => 1/0, hides the submit button
# editsum => 1/0, adds an edit summary field before the submit button
# continue => 2/1/0, replace submit button with continue buttons
+# noformcode=> 1/0, remove the formcode field
# The other arguments are a list of subforms in the form
# of (subform-name => [form parts]). Each subform is shown as a
# (JavaScript-powered) tab, and has it's own 'mainbox'. This function
@@ -182,9 +183,11 @@ sub htmlForm {
form action => '/nospam?'.$options->{action}, method => $options->{method}||'post', 'accept-charset' => 'utf-8',
$options->{upload} ? (enctype => 'multipart/form-data') : ();
- div class => 'hidden';
- input type => 'hidden', name => 'formcode', value => $self->authGetCode($options->{action});
- end;
+ if(!$options->{noformcode}) {
+ div class => 'hidden';
+ input type => 'hidden', name => 'formcode', value => $self->authGetCode($options->{action});
+ end;
+ }
$self->htmlFormError($options->{frm}, 1);