Fix parse_dn: trim key and value

master
thooge 4 years ago committed by GitHub
parent 29f3b8fe51
commit 480ab5a07b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      lib/HELPERS.pm

@ -112,6 +112,9 @@ sub parse_dn {
s/\s+$//;
($k, $v) = split(/=/);
next if(not defined($k));
# trim key and value
$k = s/^\s+|\s+$//g;
$v = s/^\s+|\s+$//g;
if($k =~ /ou/i) {
$tmp->{'OU'} or $tmp->{'OU'} = [];
push(@{$tmp->{'OU'}}, $v);