Oops - fixed small glitch in delvote_ips converter code
authorDan
Sun, 02 Sep 2007 00:33:22 -0400
changeset 113 6f357b951f7a
parent 112 008b1c42be72
child 114 47393c6619ea
Oops - fixed small glitch in delvote_ips converter code
upgrade.php
--- a/upgrade.php	Sun Sep 02 00:23:07 2007 -0400
+++ b/upgrade.php	Sun Sep 02 00:33:22 2007 -0400
@@ -380,6 +380,7 @@
       $current_is_ip = is_valid_ip($ip);
       if ( $current_is_ip && $prev_is_ip )
       {
+        $i++;
         $new['u'][] = $prev;
       }
       if ( $current_is_ip )
@@ -393,6 +394,10 @@
       $prev = $ip;
       $prev_is_ip = $current_is_ip;
     }
+    if ( $i % 2 == 1 && $prev_is_ip )
+    {
+      $new['u'][] = $ip;
+    }
     $new = serialize($new);
     $e = $db->sql_query('UPDATE '.table_prefix.'pages SET delvote_ips=\'' . $db->escape($new) . '\' WHERE urlname=\'' . $db->escape($row['urlname']) . '\' AND namespace=\'' . $db->escape($row['namespace']) . '\';');
     if ( !$e )