From ca34a4bd396774ba8d98df14eb4bba753202d981 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 21 Sep 2009 18:04:51 +0100 Subject: [PATCH] Properly reject capacity strings which start with a commodity --- yarrg/web/check_capacitystring | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yarrg/web/check_capacitystring b/yarrg/web/check_capacitystring index 3c77972..a79b6f1 100644 --- a/yarrg/web/check_capacitystring +++ b/yarrg/web/check_capacitystring @@ -88,6 +88,9 @@ my $parse_values= sub { elsif (s/^( $iqtyrex ) \s* ([a-z ]+) \s+ //xo) { my ($qty,$spec) = ($1,$2); $debugf->("VALUE COMMOD $qty '$spec'"); + expected_error("Capacity specification must start with". + " ship size or amount with units") + if $first_term; $commodsth ||= $dbh->prepare("SELECT commodname,unitmass,unitvolume FROM commods WHERE commodname LIKE ?"); -- 2.30.2