From 24ee6d02c4fa99c060a42fad818cad3e2de54651 Mon Sep 17 00:00:00 2001 From: TimZ99 Date: Tue, 3 Dec 2019 00:34:01 +0100 Subject: [PATCH] Fixed false trigger_error() after redirect. Resolves #814. --- src/bootstrap.php | 4 ++-- src/psm/Module/Config/Controller/ConfigController.php | 2 +- src/psm/Module/Server/Controller/UpdateController.php | 2 +- src/psm/Module/User/Controller/LoginController.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bootstrap.php b/src/bootstrap.php index 6f374c6f..a9b54da8 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -77,7 +77,7 @@ if (!defined('PSM_INSTALL') || !PSM_INSTALL) { if ($db->getDbHost() === null) { // no config file has been loaded, redirect the user to the install header('Location: install.php'); - trigger_error("Could not load config file. Redirect to install failed, click here.", E_USER_ERROR); + die(); } // config file has been loaded, check if we have a connection if (!$db->status()) { @@ -87,7 +87,7 @@ if (!defined('PSM_INSTALL') || !PSM_INSTALL) { if (!psm_load_conf()) { // unable to load from config table header('Location: install.php'); - trigger_error("Could not load config table. Redirect to install failed, click here.", E_USER_ERROR); + die(); } // config load OK, make sure database version is up to date $installer = new \psm\Util\Install\Installer($db); diff --git a/src/psm/Module/Config/Controller/ConfigController.php b/src/psm/Module/Config/Controller/ConfigController.php index fc0e8cfa..6e19c037 100644 --- a/src/psm/Module/Config/Controller/ConfigController.php +++ b/src/psm/Module/Config/Controller/ConfigController.php @@ -226,7 +226,7 @@ class ConfigController extends AbstractController { if ($language_refresh) { header('Location: '.psm_build_url(array('mod' => 'config'), true, false)); - trigger_error("Redirect failed.", E_USER_ERROR); + die(); } if (isset($_POST['general_submit'])) { diff --git a/src/psm/Module/Server/Controller/UpdateController.php b/src/psm/Module/Server/Controller/UpdateController.php index 4080f5d1..7b528b81 100644 --- a/src/psm/Module/Server/Controller/UpdateController.php +++ b/src/psm/Module/Server/Controller/UpdateController.php @@ -46,7 +46,7 @@ class UpdateController extends AbstractController { header('Location: '.psm_build_url(array( 'mod' => 'server_status' ), true, false)); - trigger_error("Redirect failed.", E_USER_ERROR); + die(); } } diff --git a/src/psm/Module/User/Controller/LoginController.php b/src/psm/Module/User/Controller/LoginController.php index a4fad4b5..2b9925b8 100644 --- a/src/psm/Module/User/Controller/LoginController.php +++ b/src/psm/Module/User/Controller/LoginController.php @@ -56,7 +56,7 @@ class LoginController extends AbstractController { if ($result) { // success login, redirect header('Location: '.psm_build_url($_SERVER['QUERY_STRING'])); - trigger_error("Redirect failed.", E_USER_ERROR); + die(); } else { $this->addMessage(psm_get_lang('login', 'error_login_incorrect'), 'error'); }