Re: Problem with LDAP search filter containing a backslash ('\')
Graham Barr <[email protected]> Wed, 20 Jul 2011 07:36:27 -0500
| Newsgroups | gmane.comp.lang.perl.modules.ldap |
|---|---|
| Message-ID | <[email protected]> |
On Jul 20, 2011, at 07:32 , Francis Swasey wrote: > > > On Jul 20, 2011, at 8:26, Chris Ridd <[email protected]> wrote: > >> >>> >>> >>> >> >> Graham, should _escape be made public? It seems like it would be useful. Or is manipulating the data structure returned from new the better approach? > > Perhaps a flag on the new call that indicates there are no escapes in the string so that the existing \, is not assumed to be a pre-existing escape and the \ gets escaped? That would not work consistently. consider (attr=()) Some guessing would have to go one to know that the first ) needs to be escaped I think exporting _escape as escape_ldap_filter is the best approach and users should use that as they build their filters Graham.