Skip to content

Commit 4e88248

Browse files
author
Tatsuya Sato
committed
Fix: Fails to parser when given string includes multibyte chars.
Net::LDAP::Filter::FilterParser fails to parse when a given string includes multibyte chars such as Japanese characters. But this should support it according to RFC-2254. This commit is to fix this failure.
1 parent d5a6c03 commit 4e88248

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-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]|\\[a-fA-F\d]{2})+/)
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.

0 commit comments

Comments
 (0)