Skip to content

Commit 0b0688d

Browse files
author
Jamstah
committed
Add correct filter characters.
1 parent ab19604 commit 0b0688d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/net/ldap/filter.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,11 @@ def present?(attribute)
249249
# string using a single backslash ('\') as escape.
250250
#
251251
ESCAPES = {
252-
'!' => '21', # EXCLAMATION = %x21 ; exclamation mark ("!")
253-
'&' => '26', # AMPERSAND = %x26 ; ampersand (or AND symbol) ("&")
254-
'*' => '2A', # ASTERISK = %x2A ; asterisk ("*")
255-
':' => '3A', # COLON = %x3A ; colon (":")
256-
'|' => '7C', # VERTBAR = %x7C ; vertical bar (or pipe) ("|")
257-
'~' => '7E', # TILDE = %x7E ; tilde ("~")
252+
"\0" => '00', # NUL = %x00 ; null character
253+
'*' => '2A', # ASTERISK = %x2A ; asterisk ("*")
254+
'(' => '28', # LPARENS = %x28 ; left parenthesis ("(")
255+
')' => '29', # RPARENS = %x29 ; right parenthesis (")")
256+
'\\' => '5C', # ESC = %x5C ; esc (or backslash) ("\")
258257
}
259258
# Compiled character class regexp using the keys from the above hash.
260259
ESCAPE_RE = Regexp.new(

0 commit comments

Comments
 (0)