[livejournal] r19692: LJSUP-9341: Additional check for answers...
Committer: vtroitsky
LJSUP-9341: Additional check for answers to scale type question added.U trunk/cgi-bin/LJ/Poll.pm
Modified: trunk/cgi-bin/LJ/Poll.pm
===================================================================
--- trunk/cgi-bin/LJ/Poll.pm 2011-08-11 03:12:05 UTC (rev 19691)
+++ trunk/cgi-bin/LJ/Poll.pm 2011-08-11 03:33:12 UTC (rev 19692)
@@ -1875,7 +1875,7 @@
@vals = split(/,/, $val);
} elsif ($q->type eq "scale") {
my ($from, $to, $by) = split(m!/!, $q->opts);
- if ($val < $from || $val > $to) {
+ if ($val !~ /^\d+$/ || $val < $from || $val > $to) {
$$error = LJ::Lang::ml('poll.error.pollitid');
return 0;
}
@@ -1913,7 +1913,7 @@
}
if ($q->type eq "scale") {
my ($from, $to, $by) = split(m!/!, $q->opts);
- if ($val < $from || $val > $to) {
+ if ($val !~ /^\d+$/ || $val < $from || $val > $to) {
# bogus! cheating?
$val = "";
}
