On Jul 20, 2011, at 07:32 , Francis Swasey wrote: > > > On Jul 20, 2011, at 8:26, Chris Ridd <chrisr...@mac.com> 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.