Be tolerant with whitespaces in ini file (Fixes: #1488)

environments/ppa-mbqj77/deployments/217
Xavier Guimard 7 years ago
parent 6e8efac7d0
commit e55094602e
  1. 3
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm

@ -358,6 +358,9 @@ sub getLocalConf {
# Load section parameters
foreach ( $cfg->Parameters($section) ) {
$r->{$_} = $cfg->val( $section, $_ );
# Remove spaces before and after value (#1488)
$r->{$_} =~ s/^\s*(.+?)\s*/$1/;
if ( $r->{$_} =~ /^[{\[].*[}\]]$/ || $r->{$_} =~ /^sub\s*{.*}$/ ) {
eval "\$r->{$_} = $r->{$_}";
if ($@) {

Loading…
Cancel
Save