includes/namespaces/default.php
changeset 1042 13ad9c1cb7d4
parent 997 07a26bd567a5
child 1081 745200a9cc2a
--- a/includes/namespaces/default.php	Wed Jul 08 18:50:54 2009 -0400
+++ b/includes/namespaces/default.php	Wed Jul 08 18:51:19 2009 -0400
@@ -929,10 +929,31 @@
       $cdata['urlname'] = $cdata['namespace'] . $ns_char . $cdata['urlname'];
     }
     
+    // add missing keys
+    $defaults = array(
+      'special' => 0,
+      'visible' => 0,
+      'comments_on' => 1,
+      'protected' => 0,
+      'delvotes' => 0,
+      'delvote_ips' => serialize(array()),
+      'wiki_mode' => 2,
+      'page_format' => getConfig('default_page_format', 'wikitext')
+    );
+    foreach ( $defaults as $key => $value )
+    {
+      if ( !isset($cdata[$key]) )
+        $cdata[$key] = $value;
+    }
+    
     // fix up deletion votes
     if ( empty($cdata['delvotes']) )
       $cdata['delvotes'] = 0;
     
+    // fix up deletion vote IP list
+    if ( empty($cdata['delvote_ips']) )
+      $cdata['delvote_ips'] = serialize(array());
+    
     // calculate wiki mode
     $cdata['really_wiki_mode'] = ( $cdata['wiki_mode'] == 1 || ( $cdata['wiki_mode'] == 2 && getConfig('wiki_mode', 0) == 1 ) );