ruby-ldap/ruby-net-ldap — pull request #42 by epeli (2012-05-21 14:04:23+00:00)
Title: Use negation to match values in filter syntax

We did run in few situations where net-ldap would throw an invalid "Invalid filter syntax." error even though the syntax was correct (generated by ActiveLdap 1.2.4). For example a `{` character as filter value throws and probably some others too.

So instead of listing all the allowed characters in one huge regexp I propose in this pull request to use negation to match all characters. [RFC2254][] defines that `*()\NUL` characters must be escaped so all others should be ok.

I've included tests in this commit.

[RFC2254]: http://tools.ietf.org/html/rfc2254#page-5