Skip to content

Commit 7c1877d

Browse files
author
blackhedd
committed
Augmented the value filter used in parsing rfc-2254 filters.
Thanks to Andre Nathan.
1 parent 089c737 commit 7c1877d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/net/ldap/filter.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ def self.from_rfc2254 ldap_filter_string
292292
end # class Net::LDAP::Filter
293293

294294

295+
295296
class FilterParser #:nodoc:
296297

297298
attr_reader :filter
@@ -349,13 +350,16 @@ def parse_paren_expression scanner
349350
end
350351
end
351352

353+
# Added a greatly-augmented filter contributed by Andre Nathan
354+
# for detecting special characters in values. (15Aug06)
352355
def parse_filter_branch scanner
353356
scanner.scan /\s*/
354357
if token = scanner.scan( /[\w\-_]+/ )
355358
scanner.scan /\s*/
356359
if op = scanner.scan( /\=|\<\=|\<|\>\=|\>|\!\=/ )
357360
scanner.scan /\s*/
358-
if value = scanner.scan( /[\w\*\.]+/ )
361+
#if value = scanner.scan( /[\w\*\.]+/ ) (ORG)
362+
if value = scanner.scan( /[\w\*\.\+\-@=#\$%&!]+/ )
359363
case op
360364
when "="
361365
Filter.eq( token, value )

0 commit comments

Comments
 (0)