LDAP/DB Issue Followup
| From: | James 'Chip' Kaufman | Date: | Fri, 23 Jan 2004 21:26:04 +0000 |
| Subject: | LDAP/DB Issue Followup | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-10339@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Reiterating the problem:
DB strips out '&', '!', and '?' characters, thinking they are part
of a
prepare/execute sequence. LDAP filters need to be able to use '&' and
'!' characters for their own purposes.
I solved the problem by doing this:
1) prepare query using '!' placeholder (!(sn=Smith)(fn=John))
2) execute query and pass a '&' as a parameter.
The result is an LDAP filter that looks like
(&(sn=Smith)(fn=John))
This approach is really ugly and if someone has a better idea, please
let me know. Perhaps the special characters could be escaped and the
prepare code could ignore them?
- --
James 'Chip' Kaufman
jkaufman@wamnetgov.com
952-346-3532
PGP key: 697D43DE
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQFAEZFsrlGDUWl9Q94RAq4ZAKDPxQBmk4/n/jjyRZUlN+v1uMyPjQCgsnXs
0E6xCA8eryxX0R/8mgxnI8c=
=U9Lv
-----END PGP SIGNATURE-----