Skip to content

Commit

Permalink
Util.pm: fix bug in escape_dn_value()
Browse files Browse the repository at this point in the history
The original implementation replaced any leading & trailing whitespace
with '\20', the replacement for SPACE (U+0020).
This could lead to tabulators, newlines, ... being wrongly replaced by '\20'.

This commit fixes the issue.
  • Loading branch information
marschap committed Sep 20, 2012
1 parent 4c217e8 commit 11ea6b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Net/LDAP/Util.pm
Expand Up @@ -564,7 +564,7 @@ my @values = @_;

map { $_ =~ s/([\\",=+<>#;])/\\$1/og;
$_ =~ s/([\x00-\x1F])/"\\".unpack("H2",$1)/oge;
$_ =~ s/(^\s+|\s+$)/"\\20" x length($1)/oge; } @values;
$_ =~ s/(^ +| +$)/"\\20" x length($1)/oge; } @values;

return(wantarray ? @values : $values[0]);
}
Expand Down

0 comments on commit 11ea6b1

Please sign in to comment.