submit($_POST, $_FILES); $identifier = $ctrl->getIdentifier($thesisId); $logger->logSubmission('admin', $thesisId, $identifier, $authorName); unset($_SESSION['csrf_token']); header('Location: ' . $redirect); exit(); } catch (Exception $e) { $logger->logError('admin', $e->getMessage(), [ 'author' => $authorName, 'post_keys' => array_keys($_POST), ]); 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(); }