From f6dcfd8fcf094bd0872fb491135c58ce50f0674b Mon Sep 17 00:00:00 2001 From: Yorhel Date: Mon, 7 Sep 2015 02:13:48 +0200 Subject: Handler::Discussions: Remove formcode from search form It's not verified and only uglifies the URLs. --- lib/VNDB/Handler/Discussions.pm | 2 +- lib/VNDB/Util/FormHTML.pm | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') 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); -- cgit v1.2.3