[bugs] [Bug 1292] New - LDAP searches with display names in format first_last gives empty results

bugs at bugs.horde.org bugs at bugs.horde.org
Wed Jun 25 05:48:27 PDT 2003


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

*** shadow/1292	Wed Jun 25 09:48:27 2003
--- shadow/1292.tmp.30020	Wed Jun 25 09:48:27 2003
***************
*** 0 ****
--- 1,43 ----
+ Bug#: 1292
+ Product: Horde
+ Version: 2.2 Stable
+ Platform: PHP Code
+ OS/Version: All
+ Status: NEW   
+ Resolution: 
+ Severity: normal
+ Priority: P2
+ Component: Turba
+ Area: BUILD
+ AssignedTo: chuck at horde.org                            
+ ReportedBy: juergen.obermann at hrz.uni-giessen.de               
+ URL: 
+ Summary: LDAP searches with display names in format first_last gives empty results
+ 
+ With horde 2.2.3 and turba 1.2 the LDAP search result is always an empty list,
+ if the format to display names is set to first_last. I found in lib/Turba.php
+ different code parts for formatting last_first and first_last. Using strlen()
+ instead of String::length() solves the problem.
+ 
+ $ diff -bc lib/Turba.php.dist lib/Turba.php
+ +*** lib/Turba.php.dist Mon Feb 10 11:46:30 2003
+ --- lib/Turba.php       Wed Jun 25 12:06:15 2003
+ ***************
+ *** 165,171 ****
+           }
+           if ($format == 'first_last' &&
+               is_int(strpos($name, ',')) &&
+ !             String::length($name) > String::length($lastname)) {
+               $name = preg_replace("|$lastname,\s*|", '', $name);
+               $name = $name . ' ' . $lastname;
+           }
+ --- 165,171 ----
+           }
+           if ($format == 'first_last' &&
+               is_int(strpos($name, ',')) &&
+ !             strlen($name) > strlen($lastname)) {
+               $name = preg_replace("|$lastname,\s*|", '', $name);
+               $name = $name . ' ' . $lastname;
+           }
+ 
+ 


More information about the bugs mailing list