Permalink
Browse files

RT#73202: LDIF.pm: Base64-encode values ending in spaces

Although not required by the RFC, Base64-encode those values that end in
spaces when writing LDIFs.
This makes it easier for the user to visually detect those values and
increases compatibility with other implementations (e.g. OpenLDAP's
ldapsearch).
  • Loading branch information...
1 parent 2a13dd5 commit df6cd07e1ae960c0827d2d1e2e17ba6df71f38b6 @marschap committed Dec 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Net/LDAP/LDIF.pm
View
2 lib/Net/LDAP/LDIF.pm
@@ -401,7 +401,7 @@ sub _write_attr {
$v = Encode::encode_utf8($v)
if (CHECK_UTF8 and Encode::is_utf8($v));
- if ($v =~ /(^[ :<]|[\x00-\x1f\x7f-\xff])/) {
+ if ($v =~ /(^[ :<]|[\x00-\x1f\x7f-\xff]| $)/) {
require MIME::Base64;
$ln .= ':: ' . MIME::Base64::encode($v, '');
}

0 comments on commit df6cd07

Please sign in to comment.