Don't allow silly timezones like GMT+31421858231489.
parent
c8ef5a9529
commit
4bfcb5fa14
|
@ -75,6 +75,7 @@ sub to_time(_) {
|
||||||
}
|
}
|
||||||
|
|
||||||
handle query => sub {
|
handle query => sub {
|
||||||
|
my $timezone = qr/(\w+(?:\s*[+-]0*[0-9]{1,5}(?::[0-5][0-9])?)?)?/;
|
||||||
my (
|
my (
|
||||||
# Time
|
# Time
|
||||||
$hour, $minutes, $seconds, $pm,
|
$hour, $minutes, $seconds, $pm,
|
||||||
|
@ -102,7 +103,7 @@ handle query => sub {
|
||||||
# Spaces between tokens
|
# Spaces between tokens
|
||||||
\s* \b
|
\s* \b
|
||||||
# Optional input timezone
|
# Optional input timezone
|
||||||
(\w+ (?: \s* [+-]\d+ (?: : \d\d )? )? )?
|
$timezone
|
||||||
# Spaces
|
# Spaces
|
||||||
\s+
|
\s+
|
||||||
# in keywords
|
# in keywords
|
||||||
|
@ -110,7 +111,7 @@ handle query => sub {
|
||||||
# Spaces
|
# Spaces
|
||||||
\s+
|
\s+
|
||||||
# Output timezone
|
# Output timezone
|
||||||
(\w+ (?: \s* [+-]\d+ (?: : \d\d )? )? )?
|
$timezone
|
||||||
\s* \z
|
\s* \z
|
||||||
}x or return;
|
}x or return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue