Skip to content

Commit bbf351b

Browse files
committed
Merge pull request #73 from sahglie/fix_filter_parser
colons are ':' valid filter characters
2 parents d1f70c9 + 2be5f17 commit bbf351b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/net/ldap/filter.rb

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

spec/unit/ldap/filter_parser_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@
1616
expect(Net::LDAP::Filter::FilterParser.parse(filter_string)).to be_a Net::LDAP::Filter
1717
end
1818
end
19+
context "Given string including colons ':'" do
20+
let(:filter_string) { "(ismemberof=cn=edu:berkeley:app:calmessages:deans,ou=campus groups,dc=berkeley,dc=edu)" }
21+
specify "should generate filter object" do
22+
expect(Net::LDAP::Filter::FilterParser.parse(filter_string)).to be_a Net::LDAP::Filter
23+
end
24+
end
1925
end
2026
end

0 commit comments

Comments
 (0)