Skip to content

Commit e896715

Browse files
committed
Fix using blank? since that might not exist, and also allow for adding user controls even if the paged and ber_sort flags weren't set
1 parent 9c8525c commit e896715

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/net/ldap/connection.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def search(args = nil)
425425
# this breaks when calling to_ber. (Can't force binary data to UTF-8)
426426
# we have to disable paging (even though server supports it) to get around this...
427427

428-
controls_temp = args.fetch(:controls, [])
428+
user_controls = args.fetch(:controls, [])
429429
controls = []
430430
controls <<
431431
[
@@ -435,10 +435,10 @@ def search(args = nil)
435435
rfc2696_cookie.map(&:to_ber).to_ber_sequence.to_s.to_ber,
436436
].to_ber_sequence if paged
437437
controls << ber_sort if ber_sort
438-
if controls.empty?
438+
if controls.empty? && user_controls.empty?
439439
controls = nil
440440
else
441-
controls += controls_temp unless controls_temp.blank?
441+
controls += user_controls
442442
controls = controls.to_ber_contextspecific(0)
443443
end
444444

0 commit comments

Comments
 (0)