Skip to content

Commit 4157684

Browse files
committed
Merge pull request #225 from rlanore/master
add slash to attribute value filter
2 parents 5673f83 + 07b48d3 commit 4157684

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: lib/net/ldap/filter.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ def parse_filter_branch(scanner)
752752
scanner.scan(/\s*/)
753753
if op = scanner.scan(/<=|>=|!=|:=|=/)
754754
scanner.scan(/\s*/)
755-
if value = scanner.scan(/(?:[-\[\]{}\w*.+:@=,#\$%&!'^~\s\xC3\x80-\xCA\xAF]|[^\x00-\x7F]|\\[a-fA-F\d]{2})+/u)
755+
if value = scanner.scan(/(?:[-\[\]{}\w*.+\/:@=,#\$%&!'^~\s\xC3\x80-\xCA\xAF]|[^\x00-\x7F]|\\[a-fA-F\d]{2})+/u)
756756
# 20100313 AZ: Assumes that "(uid=george*)" is the same as
757757
# "(uid=george* )". The standard doesn't specify, but I can find
758758
# no examples that suggest otherwise.

Diff for: test/test_filter_parser.rb

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ def test_brackets
1414
assert_kind_of Net::LDAP::Filter, Net::LDAP::Filter::FilterParser.parse("(cn=[{something}])")
1515
end
1616

17+
def test_slash
18+
assert_kind_of Net::LDAP::Filter, Net::LDAP::Filter::FilterParser.parse("(departmentNumber=FOO//BAR/FOO)")
19+
end
20+
1721
def test_colons
1822
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)")
1923
end

0 commit comments

Comments
 (0)