diff --git a/resources/class_cache_handler.php b/resources/class_cache_handler.php index 3a4bde2..898d9a3 100644 --- a/resources/class_cache_handler.php +++ b/resources/class_cache_handler.php @@ -337,7 +337,7 @@ function fid($old_fid) $this->cache_forums(); } - return $this->cache_fids[$old_fid]; + return isset($this->cache_fids[$old_fid]) ? $this->cache_fids[$old_fid] : 0; } /** @@ -448,7 +448,7 @@ function tid($old_tid) $this->cache_threads(); } - return $this->cache_tids[$old_tid]; + return isset($this->cache_tids[$old_tid]) ? $this->cache_tids[$old_tid] : 0; } /** diff --git a/resources/functions.php b/resources/functions.php index bb7cd71..980fff6 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -255,28 +255,11 @@ function delete_import_fields($text=true) $progress += $increment; } - $columns_to_drop = array(); foreach($columns as $column) { if($db->field_exists($column, $table)) { - $columns_to_drop[] = $column; - } - } - if(!empty($columns_to_drop)) - { - if($db->type == "sqlite") - { - // Can be achieved in a transaction if we'd finally support it. - foreach($columns_to_drop as $column) - { - $db->write_query("ALTER TABLE ".TABLE_PREFIX.$table." DROP {$column}"); - } - } - else - { - $columns_sql = implode(", DROP ", $columns_to_drop); - $db->write_query("ALTER TABLE ".TABLE_PREFIX.$table." DROP {$columns_sql}"); + $db->drop_column($table, $column); } } }