if ($pos) { WT_DB::prepare("INSERT INTO `##gedcom_chunk` (gedcom_id, chunk_data) VALUES (?, ?)")->execute(array($gedcom_id, substr($file_data, 0, $pos))); $file_data = substr($file_data, $pos); } } WT_DB::prepare("INSERT INTO `##gedcom_chunk` (gedcom_id, chunk_data) VALUES (?, ?)")->execute(array($gedcom_id, $file_data)); set_gedcom_setting($gedcom_id, 'gedcom_filename', $filename); WT_DB::exec("COMMIT"); fclose($fp); } // Process POST actions switch (WT_Filter::post('action')) { case 'delete': $gedcom_id = WT_Filter::postInteger('gedcom_id'); if (WT_Filter::checkCsrf() && $gedcom_id) { WT_Tree::delete($gedcom_id); } header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME); break; case 'setdefault': if (WT_Filter::checkCsrf()) { WT_Site::preference('DEFAULT_GEDCOM', WT_Filter::post('default_ged')); } break; case 'new_tree': $ged_name = basename(WT_Filter::post('ged_name')); if (WT_Filter::checkCsrf() && $ged_name) { WT_Tree::create($ged_name); } break; case 'replace_upload':