Actually, I found problems with that one. This one seems to work properly (Thanks Paul!):
require GT::SQL::Search::Base::Common;
my $STOPWORDS = $GT::SQL::Search::Base::Common::STOPWORDS;
my $tags = shift;
my $query = $IN->param('query');
if (exists $STOPWORDS->{$query}) {
return "The word '$query' is too common.";
}
if (length $query < 3) {
return "Your query is too short.";
}
return $tags->{error}; # Display default error
}
Sean
Code:
sub { require GT::SQL::Search::Base::Common;
my $STOPWORDS = $GT::SQL::Search::Base::Common::STOPWORDS;
my $tags = shift;
my $query = $IN->param('query');
if (exists $STOPWORDS->{$query}) {
return "The word '$query' is too common.";
}
if (length $query < 3) {
return "Your query is too short.";
}
return $tags->{error}; # Display default error
}
Sean