From: Steinar H. Gunderson Date: Wed, 16 Feb 2005 18:44:23 +0000 (+0000) Subject: Check for scores out of range, instead of giving SQL errors. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=a5bef5a751fddcaa09f7d4281e2452ea778436ca;ds=sidebyside Check for scores out of range, instead of giving SQL errors. --- diff --git a/html/do-edit-scores.pl b/html/do-edit-scores.pl index 1ae1547..be93df0 100755 --- a/html/do-edit-scores.pl +++ b/html/do-edit-scores.pl @@ -24,6 +24,10 @@ for my $p ($cgi->param()) { undef $val if ($val =~ /^\s*$/); if ($p =~ /^score(\d+)-(\d+)/) { + if (defined($val) && ($val < 0 || $val > 10000)) { + ccbs::user_error("Alle poengsummer må være mellom 0 og 10000 (inklusive)."); + } + $dbh->do('UPDATE scores SET score=? WHERE tournament=? AND round=? AND parallel=? AND player=? AND songnumber=?', undef, $val, $tournament, $round, $group, $1, $2); } elsif ($p =~ /^playmode(\d+)-(\d+)/) {