* pldap.el (ldap-decode-string): Return string as-is if
authorteranisi <teranisi>
Tue, 3 Sep 2002 00:00:42 +0000 (00:00 +0000)
committerteranisi <teranisi>
Tue, 3 Sep 2002 00:00:42 +0000 (00:00 +0000)
`ldap-coding-system' is nil.
(ldap-encode-string): Ditto.
(ldap-search-entries): Encode filter string with `ldap-encode-string'.

elmo/ChangeLog
elmo/pldap.el

index b1c93e6..5f27e8f 100644 (file)
@@ -1,3 +1,10 @@
+2002-09-03  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * pldap.el (ldap-decode-string): Return string as-is if
+       `ldap-coding-system' is nil.
+       (ldap-encode-string): Ditto.
+       (ldap-search-entries): Encode filter string with `ldap-encode-string'.
+
 2002-08-21  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * elmo-util.el (elmo-warning): Define as a macro which uses
index 15a955c..b544227 100644 (file)
@@ -812,13 +812,17 @@ entry according to the value of WITHDN."
 
 (defun ldap-decode-string (str)
   "Decode LDAP STR."
-  (if (fboundp 'decode-coding-string)
-      (decode-coding-string str ldap-coding-system)))
+  (if (and (fboundp 'decode-coding-string)
+          ldap-coding-system)
+      (decode-coding-string str ldap-coding-system)
+    str))
 
 (defun ldap-encode-string (str)
   "Encode LDAP STR."
-  (if (fboundp 'encode-coding-string)
-      (encode-coding-string str ldap-coding-system)))
+  (if (and (fboundp 'encode-coding-string)
+          ldap-coding-system)
+      (encode-coding-string str ldap-coding-system)
+    str))
 
 (defun ldap-decode-address (str)
   "Decode LDAP address STR."
@@ -915,7 +919,7 @@ entry according to the value of WITHDN."
     (setq ldap (ldap-open host host-plist))
     (if ldap-verbose
        (message "Searching with LDAP on %s..." host))
-    (setq result (ldap-search ldap filter
+    (setq result (ldap-search ldap (ldap-encode-string filter)
                              (plist-get host-plist 'base)
                              (plist-get host-plist 'scope)
                              attributes attrsonly withdn