File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -236,13 +236,13 @@ def write
236236 # Internal convenience method. It seems like the standard
237237 # approach in most LDAP tools to base64 encode an attribute
238238 # value if its first or last byte is nonprintable, or if
239- # it's a password.
239+ # it's a password. But that turns out to be not nearly good
240+ # enough. There are plenty of A/D attributes that are binary
241+ # in the middle. This is probably a nasty performance killer.
240242 def is_attribute_value_binary? value
241243 v = value . to_s
242- [ v [ 0 ] , v [ -1 ] ] . each { |byt |
243- if byt . is_a? ( Fixnum ) and ( byt < 33 or byt > 126 )
244- return true
245- end
244+ v . each_byte { |byt |
245+ return true if ( byt < 33 ) || ( byt > 126 )
246246 }
247247 if v [ 0 ..0 ] == ':' or v [ 0 ..0 ] == '<'
248248 return true
You can’t perform that action at this time.
0 commit comments