[Tickets #6039] Re: contact search box rendered PHP error
    bugs at horde.org 
    bugs at horde.org
       
    Tue Dec 25 20:44:45 UTC 2007
    
    
  
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=6039
-----------------------------------------------------------------------
 Ticket             | 6039
 Updated By         | m.gabriel at das-netzwerkteam.de
 Summary            | contact search box rendered PHP error
 Queue              | Kolab
 Type               | Bug
 State              | Assigned
 Priority           | 2. Medium
 Owners             | Gunnar Wrobel
+New Attachment     | field+needle2.patch
-----------------------------------------------------------------------
m.gabriel at das-netzwerkteam.de (2007-12-25 15:44) wrote:
another error in the _search method of the Turba_Driver_kolab_wrapper_new
class... 
the application context is already described in ticket #6046 occurred (i a
nutshell: i tried to add a CSV address book: LASTNAME, FIRSTNAME, EMAIL).
on import the following php error is rendered:
Notice: Undefined index: last-name in
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1-netzwerkteam/turba/lib/Driver/kolab.php
on line 775
this happens if the CSV contains lines like the third line in the
following example:
<snip csv-file>
Lastname, Firstname, eMail
Gabriel, Mike, user at mail.test
Onlylastname,,lastname at mail.test
</snip>
so i tuned up the _search method a little more... (patch also
attached)...
grimnir:/usr/local/share/_horde-versions_# diff -u
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1/turba/lib/Driver/kolab.php
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1-netzwerkteam/turba/lib/Driver/kolab.php
---
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1/turba/lib/Driver/kolab.php
 2007-11-29 12:32:57.000000000 +0000
+++
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1-netzwerkteam/turba/lib/Driver/kolab.php
    2007-12-25 20:31:48.000000000 +0000
@@ -764,12 +764,15 @@
                         $all_matched = true;
                         foreach ($tests as $test) {
-                            $field = $test['field'];
-                            $needle = $test['test'];
-
+
+                            $field = '';
+                            $needle = '';
+                            if (isset($test['field'])) { $field =
$test['field']; }
+                            if (isset($test['test'])) { $needle =
$test['test']; }
+
                             if (empty($needle)) {
                                 $keep_entry = true;
-                            } elseif (stristr($entry[$field], $needle)
!== false) {
+                            } elseif (isset($entry[$field]) &&
(stristr($entry[$field], $needle) !== false)) {
                                 $keep_entry = true;
                             } else {
                                 $all_matched = false;
    
    
More information about the bugs
mailing list