From 34c337435a2c340073a6f5e7f6e3d16c485183eb Mon Sep 17 00:00:00 2001 From: Okhin Date: Mon, 3 Dec 2018 17:36:09 +0100 Subject: [PATCH 1/2] Testing and setting SESSION.error and SESSION.message if they're not defined --- www/index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/index.php b/www/index.php index 6e6bf50..1a871fd 100644 --- a/www/index.php +++ b/www/index.php @@ -42,6 +42,12 @@ $f3->set('ONERROR', function ($f3) { // If there is any problem, replace the current csrf $csrf = md5(rand()); $f3->CSRF = $csrf; + + // If neither error or message are set, define them + if (!$f3->exists('SESSION.message')) + $f3->push('SESSION.message', ''); + if (!$f3->exists('SESSION.error')) + $f3->push('SESSION.error', ''); $f3->get('container')['session']->set('csrf', $csrf); while (ob_get_level()) { -- GitLab From 74334331ba93ac20f65cd0d6582fe4d6c95e1466 Mon Sep 17 00:00:00 2001 From: Okhin Date: Mon, 3 Dec 2018 17:37:48 +0100 Subject: [PATCH 2/2] make cs-fix --- www/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/index.php b/www/index.php index 1a871fd..3ad2db4 100644 --- a/www/index.php +++ b/www/index.php @@ -44,10 +44,12 @@ $f3->set('ONERROR', function ($f3) { $f3->CSRF = $csrf; // If neither error or message are set, define them - if (!$f3->exists('SESSION.message')) + if (!$f3->exists('SESSION.message')) { $f3->push('SESSION.message', ''); - if (!$f3->exists('SESSION.error')) + } + if (!$f3->exists('SESSION.error')) { $f3->push('SESSION.error', ''); + } $f3->get('container')['session']->set('csrf', $csrf); while (ob_get_level()) { -- GitLab