[bugs] [Bug 1280] Changed - Mixed case fields do not show up with LDAP backend

bugs at bugs.horde.org bugs at bugs.horde.org
Fri Jun 13 06:07:42 PDT 2003


http://bugs.horde.org/show_bug.cgi?id=1280

*** shadow/1280	Fri Jun 13 10:05:47 2003
--- shadow/1280.tmp.5413	Fri Jun 13 10:07:42 2003
***************
*** 33,35 ****
--- 33,72 ----
  But getResults does not take that fact into account and tries to compare with
  the user-entered value from sources.php without converting it to lowercase. 
  Judging by the mailing list archives, we are not the first to see this problem.
+ 
+ ------- Additional Comments From halls at debian.org  06/13/03 10:07 -------
+ Here is a diff against current CVS to fix the problem:
+ 
+ Index: ldap.php
+ ===================================================================
+ RCS file: /repository/turba/lib/Driver/ldap.php,v
+ retrieving revision 1.32
+ diff -u -r1.32 ldap.php
+ --- ldap.php    18 Mar 2003 18:14:38 -0000      1.32
+ +++ ldap.php    13 Jun 2003 12:30:28 -0000
+ @@ -241,16 +241,18 @@
+              $result = array();
+ 
+              foreach ($fields as $field) {
+ +               field_l = strtolower($field);
+ +
+                  if ($field == 'dn') {
+ -                    $result[$field] = $entry[$field];
+ +                    $result[$field] = $entry[$field_l];
+                  } else {
+                      $result[$field] = '';
+ -                    if (!empty($entry[$field])) {
+ -                        for ($j = 0; $j < $entry[$field]['count']; $j++) {
+ +                    if (!empty($entry[$field_l])) {
+ +                        for ($j = 0; $j < $entry[$field_l]['count']; $j++) {
+                              if (!empty($result[$field])) {
+                                  $result[$field] .= $this->separator;
+                              }
+ -                            $result[$field] .=
+ String::convertCharset($entry[$field][$j], $this->charset);
+ +                            $result[$field] .=
+ String::convertCharset($entry[$field_l][$j], $this->charset);
+                          }
+                      }
+                  }
+ 


More information about the bugs mailing list