From c368c01433f9bbc1e6cac4133280ff2b8ad45af3 Mon Sep 17 00:00:00 2001 From: trendschau Date: Tue, 13 Oct 2020 23:01:43 +0200 Subject: [PATCH] Fixed proxy detection and checked for empty ip settings --- system/Settings.php | 2 +- system/author/layouts/layout.twig | 16 ++++++------- system/author/layouts/layoutAuth.twig | 4 ++-- system/author/layouts/layoutBlank.twig | 2 +- system/author/layouts/layoutBlox.twig | 30 ++++++++++++------------- system/author/layouts/layoutEditor.twig | 22 +++++++++--------- system/system.php | 12 +++++----- 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/system/Settings.php b/system/Settings.php index 6119810..f29aa05 100644 --- a/system/Settings.php +++ b/system/Settings.php @@ -82,7 +82,7 @@ class Settings 'editor' => 'visual', 'formats' => ['markdown', 'headline', 'ulist', 'olist', 'table', 'quote', 'notice', 'image', 'video', 'file', 'toc', 'hr', 'definition', 'code'], 'contentFolder' => 'content', - 'version' => '1.3.8', + 'version' => '1.4.0', 'setup' => true, 'welcome' => true, 'images' => ['live' => ['width' => 820], 'thumbs' => ['width' => 250, 'height' => 150]], diff --git a/system/author/layouts/layout.twig b/system/author/layouts/layout.twig index b63a8af..31aa1b6 100644 --- a/system/author/layouts/layout.twig +++ b/system/author/layouts/layout.twig @@ -17,8 +17,8 @@ - - + + {{ assets.renderCSS() }} @@ -41,16 +41,16 @@ - + - - - - - + + + + + diff --git a/system/author/layouts/layoutAuth.twig b/system/author/layouts/layoutAuth.twig index 24ce000..7d2790b 100644 --- a/system/author/layouts/layoutAuth.twig +++ b/system/author/layouts/layoutAuth.twig @@ -18,7 +18,7 @@ - + {{ assets.renderCSS() }} @@ -32,6 +32,6 @@ {% block content %}{% endblock %} - + \ No newline at end of file diff --git a/system/author/layouts/layoutBlank.twig b/system/author/layouts/layoutBlank.twig index 55a25e2..031193a 100644 --- a/system/author/layouts/layoutBlank.twig +++ b/system/author/layouts/layoutBlank.twig @@ -17,7 +17,7 @@ - + diff --git a/system/author/layouts/layoutBlox.twig b/system/author/layouts/layoutBlox.twig index 8e68602..51fc28e 100644 --- a/system/author/layouts/layoutBlox.twig +++ b/system/author/layouts/layoutBlox.twig @@ -18,7 +18,7 @@ - + {{ assets.renderCSS() }} @@ -46,28 +46,28 @@ const myaxios = axios.create(); myaxios.defaults.baseURL = "{{ base_url }}"; - - - - - - + + + + + + {{ assets.renderEditorJS() }} - - - - - - - + + + + + + + {{ assets.renderJS() }} diff --git a/system/author/layouts/layoutEditor.twig b/system/author/layouts/layoutEditor.twig index c50f816..460b9fc 100644 --- a/system/author/layouts/layoutEditor.twig +++ b/system/author/layouts/layoutEditor.twig @@ -17,7 +17,7 @@ - + {{ assets.renderCSS() }} @@ -39,16 +39,16 @@ - + - - - - - + + + + + - - - + + + + {{ assets.renderJS() }} diff --git a/system/system.php b/system/system.php index 904f012..4d97399 100644 --- a/system/system.php +++ b/system/system.php @@ -48,12 +48,6 @@ $app = new \Slim\App($settings); $container = $app->getContainer(); -if(isset($settings['settings']['proxy']) && $settings['settings']['proxy']) -{ - $trustedProxies = isset($settings['settings']['trustedproxies']) ? explode(",", $settings['settings']['trustedproxies']) : []; - $app->add(new RKA\Middleware\ProxyDetection($trustedProxies)); -} - /************************ * LOAD & UPDATE PLUGINS * ************************/ @@ -318,6 +312,12 @@ if($container['flash']) $app->add($container->get('csrf')); } +if(isset($settings['settings']['proxy']) && $settings['settings']['proxy']) +{ + $trustedProxies = ( isset($settings['settings']['trustedproxies']) && !empty($settings['settings']['trustedproxies']) ) ? explode(",", $settings['settings']['trustedproxies']) : []; + $app->add(new RKA\Middleware\ProxyDetection($trustedProxies)); +} + /************************ * ADD ROUTES * ************************/