Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 11ea6b176a0e728d10cc3219cbb84fd8018df5a6 1 parent 4c217e8
Peter Marschall authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Net/LDAP/Util.pm
2  lib/Net/LDAP/Util.pm
View
@@ -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]);
}
Please sign in to comment.
Something went wrong with that request. Please try again.