Skip to content

Commit

Permalink
RT#73202: LDIF.pm: Base64-encode values ending in spaces
Browse files Browse the repository at this point in the history
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
marschap committed Mar 9, 2013
1 parent 2a13dd5 commit df6cd07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Net/LDAP/LDIF.pm
Expand Up @@ -401,7 +401,7 @@ sub _write_attr {


$v = Encode::encode_utf8($v) $v = Encode::encode_utf8($v)
if (CHECK_UTF8 and Encode::is_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; require MIME::Base64;
$ln .= ':: ' . MIME::Base64::encode($v, ''); $ln .= ':: ' . MIME::Base64::encode($v, '');
} }
Expand Down

0 comments on commit df6cd07

Please sign in to comment.