summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Traits.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-09-20 08:47:07 +0200
committerYorhel <git@yorhel.nl>2015-09-20 08:47:07 +0200
commit940b089ea5f02ef9bc80b4b82c320c4e9d2dbb34 (patch)
tree4c9be57fb3a07e8e04b5714623e6f7a40fb06a5a /lib/VNDB/Handler/Traits.pm
parentcf8e093eace0f3a86fc42726b09e4f2c9979f40e (diff)
Update usage kv_validate() to upcoming TUWF 1.0
And added new 'page' and 'id' templates for more strict validation.
Diffstat (limited to 'lib/VNDB/Handler/Traits.pm')
-rw-r--r--lib/VNDB/Handler/Traits.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/VNDB/Handler/Traits.pm b/lib/VNDB/Handler/Traits.pm
index a69e8763..98f0b757 100644
--- a/lib/VNDB/Handler/Traits.pm
+++ b/lib/VNDB/Handler/Traits.pm
@@ -25,7 +25,7 @@ sub traitpage {
return $self->resNotFound if !$t;
my $f = $self->formValidate(
- { get => 'p', required => 0, default => 1, template => 'int' },
+ { get => 'p', required => 0, default => 1, template => 'page' },
{ get => 'm', required => 0, default => $self->authPref('spoilers')||0, enum => [qw|0 1 2|] },
{ get => 'fil', required => 0, default => '' },
);
@@ -144,7 +144,7 @@ sub traitedit {
{ post => 'alias', required => 0, maxlength => 1024, default => '', regex => [ qr/^[^,]+$/s, 'No comma allowed in aliases' ] },
{ post => 'description', required => 0, maxlength => 10240, default => '' },
{ post => 'parents', required => !$self->authCan('tagmod'), default => '', regex => [ qr/^(?:$|(?:[1-9]\d*)(?: +[1-9]\d*)*)$/, 'Parent traits must be a space-separated list of trait IDs' ] },
- { post => 'order', required => 0, default => 0, template => 'int', min => 0 },
+ { post => 'order', required => 0, default => 0, template => 'uint' },
);
my @parents = split /[\t ]+/, $frm->{parents};
my $group = undef;
@@ -254,7 +254,7 @@ sub traitlist {
my $f = $self->formValidate(
{ get => 's', required => 0, default => 'name', enum => ['added', 'name'] },
{ get => 'o', required => 0, default => 'a', enum => ['a', 'd'] },
- { get => 'p', required => 0, default => 1, template => 'int' },
+ { get => 'p', required => 0, default => 1, template => 'page' },
{ get => 't', required => 0, default => -1, enum => [ -1..2 ] },
{ get => 'q', required => 0, default => '' },
);
@@ -403,8 +403,8 @@ sub traitxml {
my $f = $self->formValidate(
{ get => 'q', required => 0, maxlength => 500 },
- { get => 'id', required => 0, multi => 1, template => 'int' },
- { get => 'r', required => 0, default => 15, template => 'int', min => 1, max => 200 },
+ { get => 'id', required => 0, multi => 1, template => 'id' },
+ { get => 'r', required => 0, default => 15, template => 'uint', min => 1, max => 200 },
);
return $self->resNotFound if $f->{_err} || (!$f->{q} && !$f->{id} && !$f->{id}[0]);