fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-12-10 07:02 am

[dw-free] fix warnings in htdocs/manage/circle/add.bml

[commit: http://hg.dwscoalition.org/dw-free/rev/05a3090468de]

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

Reset count variable, instead of (mistakenly) checking for equality; also
don't double-declare the variable with "my" in the same scope.

Patch by [personal profile] kareila.

Files modified:
  • htdocs/manage/circle/add.bml
--------------------------------------------------------------------------------
diff -r cb77ef4e7de8 -r 05a3090468de htdocs/manage/circle/add.bml
--- a/htdocs/manage/circle/add.bml	Fri Dec 10 14:58:46 2010 +0800
+++ b/htdocs/manage/circle/add.bml	Fri Dec 10 15:01:51 2010 +0800
@@ -383,9 +383,15 @@ _c?>
    // -->
    </script>
    ~;
-        if ($col==23) { $ret .= "</tr>\n"; $col==0; }
+        if ( $col == 23 ) {
+            $ret .= "</tr>\n";
+            $col = 0;
+        }
     }
-    if ($col) { $ret .= "</tr>\n"; $col==0; }
+    if ( $col ) {
+        $ret .= "</tr>\n";
+        $col = 0;
+    }
     my $col2 = 0;
 
     # without javascript
@@ -404,9 +410,15 @@ _c?>
    <td $colspan bgcolor='$_->{code}'><img src='/img/dot.gif' width='$wh' height='16' title='$ecolor - $_->{code}' alt='$ecolor - $_->{code}'
    border='0'></td>
    ~;
-        if ($col2==23) { $ret2 .= "</tr>\n"; $col2==0; }
+        if ( $col2 == 23 ) {
+            $ret2 .= "</tr>\n";
+            $col2 = 0;
+        }
     }
-    if ($col2) { $ret2 .= "</tr>\n"; $col2==0; }
+    if ( $col2 ) {
+        $ret2 .= "</tr>\n";
+        $col2 = 0;
+    }
 
     $ret2 .= "</noscript>";
 
@@ -445,7 +457,7 @@ _c?>
     $ret .= "id=\"editfriend_add_1_bg\" /></td>";
 
     ### color swatch
-    my $col = 0;
+    $col = 0;
     $ret .= "<td><table summary='' border='0' cellspacing='0' cellpadding='0'>";
     # with javascript
     foreach (@color) {
@@ -470,14 +482,20 @@ _c?>
    // -->
    </script>
    ~;
-        if ($col==23) { $ret .= "</tr>\n"; $col==0; }
+        if ( $col == 23 ) {
+            $ret .= "</tr>\n";
+            $col = 0;
+        }
     }
-    if ($col) { $ret .= "</tr>\n"; $col==0; }
+    if ( $col ) {
+        $ret .= "</tr>\n";
+        $col = 0;
+    }
 
-    my $col2 = 0;
+    $col2 = 0;
 
     # without javascript
-    my $ret2 = "<noscript>\n";
+    $ret2 = "<noscript>\n";
     foreach (@color) {
         if ($col2==0) { $ret2 .= "<tr>\n"; }
         $col2++;
@@ -491,9 +509,15 @@ _c?>
         $ret2 .= qq~
    <td $colspan bgcolor='$_->{code}'><img src='/img/dot.gif' width='$wh' height='16' title='$ecolor - $_->{code}' alt='$ecolor - $_->{code}' border='0'></td>
    ~;
-        if ($col2==23) { $ret2 .= "</tr>\n"; $col2==0; }
+        if ( $col2 == 23 ) {
+            $ret2 .= "</tr>\n";
+            $col2 = 0;
+        }
     }
-    if ($col2) { $ret2 .= "</tr>\n"; $col2==0; }
+    if ( $col2 ) {
+        $ret2 .= "</tr>\n";
+        $col2 = 0;
+    }
 
 
     $ret2 .= "</noscript>";
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org