Branch: Tag:

2001-11-21

2001-11-21 16:22:42 by Anders Johansson <anders@roxen.com>

Safeguard in case of empty filter string.

Rev: lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1.28

2:      // LDAP client protocol implementation for Pike.   // - // $Id: client.pike,v 1.27 2001/11/05 11:53:20 hop Exp $ + // $Id: client.pike,v 1.28 2001/11/21 16:22:42 anders Exp $   //   // Honza Petrous, hop@unibase.cz   //
349:    void create(string|void url, object|void context)    {    -  info = ([ "code_revision" : ("$Revision: 1.27 $"/" ")[1] ]); +  info = ([ "code_revision" : ("$Revision: 1.28 $"/" ")[1] ]);       if(!url || !sizeof(url))    url = LDAP_DEFAULT_URL;
789:    int op ;       DWRITE("client.make_filter: filter=["+filter+"]\n"); +  +  if (!sizeof(filter)) return make_simple_filter(filter); +     // strip leading and trailing spaces -  while(filter[0] == ' ') -  filter = filter[1..]; -  while(filter[-1] == ' ') -  filter = reverse(reverse(filter)[1..]); +  filter = String.trim_all_whites(filter);       // strip leading and trailing brackets   #if 1