From 8634d2712bc84a3cdcff6c93e1371fae0cef7309 Mon Sep 17 00:00:00 2001 From: Kevin McCormack Date: Sat, 1 Feb 2020 14:51:05 -0500 Subject: [PATCH] Support parsing filters with attribute tags Closes #340 --- lib/net/ldap/filter.rb | 2 +- test/test_filter_parser.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/net/ldap/filter.rb b/lib/net/ldap/filter.rb index 6f064488..94652327 100644 --- a/lib/net/ldap/filter.rb +++ b/lib/net/ldap/filter.rb @@ -755,7 +755,7 @@ def parse_paren_expression(scanner) # This parses a given expression inside of parentheses. def parse_filter_branch(scanner) scanner.scan(/\s*/) - if token = scanner.scan(/[-\w:.]*[\w]/) + if token = scanner.scan(/[-\w:.;]*[\w]/) scanner.scan(/\s*/) if op = scanner.scan(/<=|>=|!=|:=|=/) scanner.scan(/\s*/) diff --git a/test/test_filter_parser.rb b/test/test_filter_parser.rb index 6f1ca48b..82fb27d3 100644 --- a/test/test_filter_parser.rb +++ b/test/test_filter_parser.rb @@ -21,4 +21,8 @@ def test_slash 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 + + def test_attr_tag + assert_kind_of Net::LDAP::Filter, Net::LDAP::Filter::FilterParser.parse("(mail;primary=jane@example.org)") + end end pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy