0 ? $urlArray[1] : null; $paperSlug = isset($urlArray[0]) ? urldecode($urlArray[0]) : null; if ($session->isLoggedInUserAlive()){ header("Location: /past-paper-answers-user/$paperSlug/$paperId"); } if (!is_numeric($paperId) && is_numeric($paperSlug)) { if (!isset($paperId)) $newPaperId = $urlArray[0]; $newPaperSlug = isset($urlArray[1]) ? urldecode($urlArray[1]) : null; $email = new EmailClass(); $email->notifyAdminOfInvalidPastPaperAnswerURL($refUrl, $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], $newPaperId, $newPaperSlug); header("HTTP/1.1 301 Moved Permanently"); header("Location: /past-papers-answer/$newPaperSlug/$newPaperId"); exit(); } include_once $rootDir . '/past-paper-answers-inner.php'; include_once "chatplugin.php"; ?>