if (ViewHelper::$mod_rewrite && strlen($requestUrl) > 1 && substr($requestUrl, -1) != '/') { header('HTTP/1.1 301 Moved Permanently'); header('Location: /' . BASE_PATH . $requestUrl . '/'); exit; } // strip any leading/trailing slashes $requestUrl = trim($requestUrl, '/'); } // if mod_rewrite is available and we're on a legacy url, redirect to the new, nicer one if (ViewHelper::$mod_rewrite && isset($_GET['p'])) { header('HTTP/1.1 301 Moved Permanently'); header('Location: /' . BASE_PATH . $requestUrl); exit; } // checks for new updates and installs them if updates are enabled if (UpdateHelper::check()) { // if it did install updates, redirects to this page again to make sure nothing gets broken as files are changed header('Location: /' . BASE_PATH . '/' . $requestUrl . '?updated=1'); exit; } ob_start(); if (!ErrorHelper::hasErrors()) { $presskit = new PresskitController(); } if (!ErrorHelper::hasErrors()) { if (isset($_POST['email'])) { $presskit->email($requestUrl); } else { if ($requestUrl == '') { $presskit->index(); } else {