beep bop boop
This commit is contained in:
parent
7cb1fe36bb
commit
1b524d7996
|
@ -41,7 +41,7 @@ sub CheckExpiry {
|
||||||
sub ValidateParams {
|
sub ValidateParams {
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
return undef unless $params->{code};
|
return undef unless $params->{code};
|
||||||
#TODO: Allow all 'word' characters rather than just a-zA-Z0-9, expanded grammar
|
#TODO: Allow all 'word' characters rather than just a-zA-Z0-9 and limited grammar
|
||||||
## Presently this is limited so people can't do anything nasty.
|
## Presently this is limited so people can't do anything nasty.
|
||||||
return undef unless $params->{title} =~ /^[a-zA-Z0-9\.\-_ @\(\)]{0,255}$/;
|
return undef unless $params->{title} =~ /^[a-zA-Z0-9\.\-_ @\(\)]{0,255}$/;
|
||||||
return undef unless $params->{lang} =~ /^[a-z0-9\.\-\+# ]{0,40}$/;
|
return undef unless $params->{lang} =~ /^[a-z0-9\.\-\+# ]{0,40}$/;
|
||||||
|
@ -52,14 +52,14 @@ sub GetPaste {
|
||||||
my $id = shift; $id = lc $id;
|
my $id = shift; $id = lc $id;
|
||||||
return undef unless $id =~ /^[a-f0-9]*$/;
|
return undef unless $id =~ /^[a-f0-9]*$/;
|
||||||
#This got a bit messy, required because otherwise there are scenarios where an expired paste may still be viewed
|
#This got a bit messy, required because otherwise there are scenarios where an expired paste may still be viewed
|
||||||
return schema->resultset('Paste')->single({
|
return schema->resultset('Paste')->single( {
|
||||||
-and => [
|
-and => [
|
||||||
{ id => $id },
|
{ id => $id },
|
||||||
-or => [
|
-or => [
|
||||||
{ expiration => { '>=' => DateTimeToQueryable() }},
|
{ expiration => { '>=' => DateTimeToQueryable() }},
|
||||||
{ expiration => undef }
|
{ expiration => undef }
|
||||||
]
|
]
|
||||||
]}) || undef;
|
] } ) || undef;
|
||||||
}
|
}
|
||||||
sub StorePaste {
|
sub StorePaste {
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
|
|
Loading…
Reference in New Issue