File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -208,12 +208,12 @@ def to_ber
208208 end
209209 [ @left . to_s . to_ber , seq . to_ber ] . to_ber_contextspecific 4
210210 else #equality
211- [ @left . to_s . to_ber , @right . to_ber ] . to_ber_contextspecific 3
211+ [ @left . to_s . to_ber , unescape ( @right ) . to_ber ] . to_ber_contextspecific 3
212212 end
213213 when :ge
214- [ @left . to_s . to_ber , @right . to_ber ] . to_ber_contextspecific 5
214+ [ @left . to_s . to_ber , unescape ( @right ) . to_ber ] . to_ber_contextspecific 5
215215 when :le
216- [ @left . to_s . to_ber , @right . to_ber ] . to_ber_contextspecific 6
216+ [ @left . to_s . to_ber , unescape ( @right ) . to_ber ] . to_ber_contextspecific 6
217217 when :and
218218 ary = [ @left . coalesce ( :and ) , @right . coalesce ( :and ) ] . flatten
219219 ary . map { |a | a . to_ber } . to_ber_contextspecific ( 0 )
@@ -229,6 +229,12 @@ def to_ber
229229 end
230230 end
231231
232+ def unescape ( right )
233+ right . gsub ( /\\ ([a-fA-F\d ]{2,2})/ ) do
234+ [ $1. hex ] . pack ( "U" )
235+ end
236+ end
237+
232238
233239 # Converts an LDAP search filter in BER format to an Net::LDAP::Filter
234240 # object. The incoming BER object most likely came to us by parsing an
You can’t perform that action at this time.
0 commit comments