Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/net/ldap/filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,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]|\\[a-fA-F\d]{2})+/)
if value = scanner.scan(/(?:[-\w*.+@=,#\$%&!'\s\xC3\x80-\xCA\xAF]|[^\x00-\x7F]|\\[a-fA-F\d]{2})+/u)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# 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
20 changes: 20 additions & 0 deletions spec/unit/ldap/filter_parser_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# encoding: utf-8
require 'spec_helper'

describe Net::LDAP::Filter::FilterParser do

describe "#parse" do
context "Given ASCIIs as filter string" do
let(:filter_string) { "(cn=name)" }
specify "should generate filter object" do
expect(Net::LDAP::Filter::FilterParser.parse(filter_string)).to be_a Net::LDAP::Filter
end
end
context "Given string including multibyte chars as filter string" do
let(:filter_string) { "(cn=名前)" }
specify "should generate filter object" do
expect(Net::LDAP::Filter::FilterParser.parse(filter_string)).to be_a Net::LDAP::Filter
end
end
end
end