diff options
Diffstat (limited to 'lib/VNDBUtil.pm')
-rw-r--r-- | lib/VNDBUtil.pm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/VNDBUtil.pm b/lib/VNDBUtil.pm index c8cd1bc1..a534856f 100644 --- a/lib/VNDBUtil.pm +++ b/lib/VNDBUtil.pm @@ -23,6 +23,7 @@ sub shorten { # Also 'normalizes' the first argument in place sub gtintype { $_[0] =~ s/[^\d]+//g; + return undef if $_[0] !~ /^[0-9]{10,13}$/; # I've yet to see a UPC code shorter than 10 digits assigned to a game $_[0] = ('0'x(12-length $_[0])) . $_[0] if length($_[0]) < 12; # pad with zeros to GTIN-12 my $c = shift; return undef if $c !~ /^[0-9]{12,13}$/; |