mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2012-07-21 02:10 am

[dw-free] uninitialized value errors in Poll.pm

[commit: http://hg.dwscoalition.org/dw-free/rev/0509339ecc10]

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

Fix some warnings for undef variables

Patch by [staff profile] denise.

Files modified:
  • cgi-bin/LJ/Poll.pm
--------------------------------------------------------------------------------
diff -r 5a460225ef6e -r 0509339ecc10 cgi-bin/LJ/Poll.pm
--- a/cgi-bin/LJ/Poll.pm	Fri Jul 20 19:11:02 2012 -0700
+++ b/cgi-bin/LJ/Poll.pm	Fri Jul 20 19:14:11 2012 -0700
@@ -1181,6 +1181,8 @@
             if ($q->type eq 'scale') {
                 my ( $from, $to, $by, $lowlabel, $highlabel ) = split( m!/!, $q->opts );
                 $by = 1 unless ($by > 0 and int($by) == $by);
+                $highlabel //= "";
+                $lowlabel //= "";
 
                 push @items, [ $from, "$lowlabel $from" ];
                 for (my $at=$from+$by; $at<=$to-$by; $at+=$by) {
--------------------------------------------------------------------------------