fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-11-03 05:18 am

[dw-free] clean up shifts in LJ::Poll

[commit: http://hg.dwscoalition.org/dw-free/rev/902e293aa620]

http://bugs.dwscoalition.org/show_bug.cgi?id=3177

More warnings cleanup.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/LJ/Poll.pm
  • cgi-bin/LJ/Poll/Question.pm
--------------------------------------------------------------------------------
diff -r 4756db2b8254 -r 902e293aa620 cgi-bin/LJ/Poll.pm
--- a/cgi-bin/LJ/Poll.pm	Wed Nov 03 10:58:54 2010 +0800
+++ b/cgi-bin/LJ/Poll.pm	Wed Nov 03 13:18:06 2010 +0800
@@ -1402,8 +1402,10 @@ sub process_submission {
             if (length($val) > 0) { # if the user answered to this question
                 my @num_opts = split( /,/, $val );
                 my $num_opts = scalar @num_opts;  # returns the number of options they answered
-                
+
                 my ($checkmin, $checkmax) = split(m!/!, $q->opts);
+                $checkmin ||= 0;
+                $checkmax ||= 255;
             
                 if($num_opts < $checkmin) {
                     $$error = LJ::Lang::ml('poll.error.checkfewoptions', {'question' => $qid, 'options' => $checkmin});
diff -r 4756db2b8254 -r 902e293aa620 cgi-bin/LJ/Poll/Question.pm
--- a/cgi-bin/LJ/Poll/Question.pm	Wed Nov 03 10:58:54 2010 +0800
+++ b/cgi-bin/LJ/Poll/Question.pm	Wed Nov 03 13:18:06 2010 +0800
@@ -202,7 +202,7 @@ sub opts {
 sub opts {
     my $self = shift;
     $self->_load;
-    return $self->{opts};
+    return $self->{opts} || '';
 }
 *text = \&qtext;
 sub qtext {
--------------------------------------------------------------------------------