submit($_POST, $_FILES); unset($_SESSION['csrf_token']); header('Location: ' . $redirect); exit(); } catch (Exception $e) { error_log('ThesisCreateController error: ' . $e->getMessage()); App::flash('error', $e->getMessage()); $_SESSION['form_data'] = $_POST; $redirect = '../add.php'; $autofocusField = ThesisCreateController::autofocusFieldForError($e->getMessage()); if ($autofocusField !== null) { App::flashAutofocus($autofocusField); } header('Location: ' . $redirect); exit(); }