From e629a35ea29dd9da9f61511130cbbee6d910e4cf Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Fri, 6 May 2022 02:24:42 +0200 Subject: switched to toml config format improved security with load over require --- lib/JWebmail.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/JWebmail.pm') diff --git a/lib/JWebmail.pm b/lib/JWebmail.pm index 98001a1..8c01596 100644 --- a/lib/JWebmail.pm +++ b/lib/JWebmail.pm @@ -2,6 +2,8 @@ package JWebmail v1.2.0; use Mojo::Base Mojolicious; +use Module::Load 'load'; + use JWebmail::Controller::Webmail; use JWebmail::Model::ReadMails::Role; use JWebmail::Model::ReadMails::QMailAuthuser; @@ -43,7 +45,7 @@ sub startup { # load plugins push @{$self->plugins->namespaces}, 'JWebmail::Plugin'; - $self->plugin('INIConfig'); + $self->plugin('TOMLConfig'); #die unless $self->validateConf; $self->plugin('ServerSideSessionData'); @@ -57,7 +59,7 @@ sub startup { my $read_mails = do { if ($mode eq 'development') { my $cls = $self->config->{development}{read_mock}; - eval "require $cls" || die "Issue for module $cls with: $@"; + eval { load $cls; 1 } || die "Issue for module $cls with: $@"; $cls->new; } else { -- cgit v1.2.3