Add non-numeric package check to USPS driver.

This commit is contained in:
Colin Kuskie 2009-11-07 12:58:49 -08:00
parent e647c013b9
commit 0a3836bde3

View file

@ -199,7 +199,7 @@ sub _calculateFromXML {
my $id = $package->{ID};
my $rate = $package->{Postage}->{Rate};
##Error check for invalid index
if ($id < 0 || $id > $#shippableUnits) {
if ($id < 0 || $id > $#shippableUnits || $id !~ /^\d+$/) {
WebGUI::Error::Shop::RemoteShippingRate->throw(error => "Illegal package index returned by USPS: $id");
}
if (exists $package->{Error}) {