Browse files

Util.pm: fix bug in escape_dn_value()

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...
1 parent 4c217e8 commit 11ea6b176a0e728d10cc3219cbb84fd8018df5a6 @marschap marschap committed Sep 19, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Net/LDAP/Util.pm
View
2 lib/Net/LDAP/Util.pm
@@ -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]);
}

0 comments on commit 11ea6b1

Please sign in to comment.