public function _unload_zip(Validation $post, $field) { $zipfile = $post["zip_file"]["tmp_name"]; if (false !== ($extract_path = themeroller::extract_zip_file($zipfile))) { $theme_name = themeroller::get_theme_name($extract_path); if (!empty($theme_name)) { Session::instance()->set("themeroller_name", $theme_name); } else { Kohana_Log::add("error", "zip file: css directory not found"); $post->add_error($field, "invalid zipfile"); } } else { Kohana_Log::add("error", "zip file: open failed"); $post->add_error($field, "invalid zipfile"); } if (file_exists($zipfile)) { unlink($zipfile); } }