Skip to content

Commit

Permalink
Merge pull request #225 from rlanore/master
Browse files Browse the repository at this point in the history
add slash to attribute value filter
  • Loading branch information
jch committed Sep 29, 2015
2 parents 5673f83 + 07b48d3 commit 4157684
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/net/ldap/filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def parse_filter_branch(scanner)
scanner.scan(/\s*/)
if op = scanner.scan(/<=|>=|!=|:=|=/)
scanner.scan(/\s*/)
if value = scanner.scan(/(?:[-\[\]{}\w*.+:@=,#\$%&!'^~\s\xC3\x80-\xCA\xAF]|[^\x00-\x7F]|\\[a-fA-F\d]{2})+/u)
if value = scanner.scan(/(?:[-\[\]{}\w*.+\/:@=,#\$%&!'^~\s\xC3\x80-\xCA\xAF]|[^\x00-\x7F]|\\[a-fA-F\d]{2})+/u)
# 20100313 AZ: Assumes that "(uid=george*)" is the same as
# "(uid=george* )". The standard doesn't specify, but I can find
# no examples that suggest otherwise.
Expand Down
4 changes: 4 additions & 0 deletions test/test_filter_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def test_brackets
assert_kind_of Net::LDAP::Filter, Net::LDAP::Filter::FilterParser.parse("(cn=[{something}])")
end

def test_slash
assert_kind_of Net::LDAP::Filter, Net::LDAP::Filter::FilterParser.parse("(departmentNumber=FOO//BAR/FOO)")
end

def test_colons
assert_kind_of Net::LDAP::Filter, Net::LDAP::Filter::FilterParser.parse("(ismemberof=cn=edu:berkeley:app:calmessages:deans,ou=campus groups,dc=berkeley,dc=edu)")
end
Expand Down

0 comments on commit 4157684

Please sign in to comment.