[Tickets #1146] NEW: doesn't properly quote

bugs at bugs.horde.org bugs at bugs.horde.org
Thu Jan 13 06:38:05 PST 2005


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=1146
-----------------------------------------------------------------------
 Ticket     | 1146
 Created By | ldillon at sk-tech.com
 Summary    | doesn't properly quote
 Queue      | Turba
 Version    | HEAD
 State      | Unconfirmed
 Priority   | 1. Low
 Type       | Bug
 Owners     | 
-----------------------------------------------------------------------


ldillon at sk-tech.com (2005-01-13 06:38) wrote:

If the entry has a comma in it (for example, lastname, firstname), it
doesn't properly quote the string.  The following fixes this:



--- /tmp/ldap.php.org	2005-01-13 08:37:13.727402078 -0600
+++ ldap.php	2005-01-13 08:31:39.689948716 -0600
@@ -290,7 +290,11 @@
                 $newrdn = '';
                 foreach ($this->_params['dn'] as $param) {
                     if (isset($attributes[$param])) {
-                        $newrdn .= $param . '=' . $attributes[$param] .
',';
+			if (strpos($attributes[$param],',') === false) {
+                            $newrdn .= $param . '=' . $attributes[$param] .
',';
+			} else {
+			    $newrdn .= $param . '="' . $attributes[$param] . '",';
+			}
                     }
                 }
                 $newrdn = substr($newrdn, 0, -1);





More information about the bugs mailing list