Undefined index in addressbook backends. Possible trigger is import plugins.
authorjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 9 Nov 2005 20:15:45 +0000 (20:15 +0000)
committerjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 9 Nov 2005 20:15:45 +0000 (20:15 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10304 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/abook_database.php
functions/abook_local_file.php

index 9606c7b5b4101f34bda6bad42bb87bd403ea47d7..f39db56d4e2274449103215c002f1551cb0da5a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -472,6 +472,7 @@ Version 1.5.1 -- CVS
     before compose page has reloaded.
   - Undefined variable in rare case in view_header.php
   - Variable by reference fix in printer_friendly_bottom.php.
+  - Undefined index in addressbook backends.
 
 
 Version 1.5.0 - 2 February 2004
index bae187bce3d7ec43c25a46487d959b45f4cd37b9..51cdbb698e357bd54f4c767d2aa5ee24f945ea55 100644 (file)
@@ -327,9 +327,9 @@ class abook_database extends addressbook_backend {
                          $this->table, $this->owner,
                          $this->dbh->quoteString($userdata['nickname']),
                          $this->dbh->quoteString($userdata['firstname']),
-                         $this->dbh->quoteString($userdata['lastname']),
+                         $this->dbh->quoteString((!empty($userdata['lastname'])?$userdata['lastname']:'')),
                          $this->dbh->quoteString($userdata['email']),
-                         $this->dbh->quoteString($userdata['label']) );
+                         $this->dbh->quoteString((!empty($userdata['label'])?$userdata['label']:'')) );
 
          /* Do the insert */
          $r = $this->dbh->simpleQuery($query);
@@ -407,9 +407,9 @@ class abook_database extends addressbook_backend {
                          $this->table,
                          $this->dbh->quoteString($userdata['nickname']),
                          $this->dbh->quoteString($userdata['firstname']),
-                         $this->dbh->quoteString($userdata['lastname']),
+                         $this->dbh->quoteString((!empty($userdata['lastname'])?$userdata['lastname']:'')),
                          $this->dbh->quoteString($userdata['email']),
-                         $this->dbh->quoteString($userdata['label']),
+                         $this->dbh->quoteString((!empty($userdata['label'])?$userdata['label']:'')),
                          $this->owner,
                          $this->dbh->quoteString($alias) );
 
@@ -426,4 +426,4 @@ class abook_database extends addressbook_backend {
 } /* End of class abook_database */
 
 // vim: et ts=4
-?>
\ No newline at end of file
+?>
index a7d4836a06a17cac59f6b2d22d4a856f3773b646..762377c3a09ee6835bd679ebead5ffc07ce140c6 100644 (file)
@@ -368,9 +368,9 @@ class abook_local_file extends addressbook_backend {
         /* Here is the data to write */
         $data = $this->quotevalue($userdata['nickname']) . '|' .
                 $this->quotevalue($userdata['firstname']) . '|' .
-                $this->quotevalue($userdata['lastname']) . '|' .
+                $this->quotevalue((!empty($userdata['lastname'])?$userdata['lastname']:'')) . '|' .
                 $this->quotevalue($userdata['email']) . '|' .
-                $this->quotevalue($userdata['label']);
+                $this->quotevalue((!empty($userdata['label'])?$userdata['label']:''));
 
         /* Strip linefeeds */
         $data = ereg_replace("[\r\n]", ' ', $data);
@@ -476,9 +476,9 @@ class abook_local_file extends addressbook_backend {
             } else {
                 $rows[$i++] = array(0 => $userdata['nickname'],
                                     1 => $userdata['firstname'],
-                                    2 => $userdata['lastname'],
+                                    2 => (!empty($userdata['lastname'])?$userdata['lastname']:''),
                                     3 => $userdata['email'],
-                                    4 => $userdata['label']);
+                                    4 => (!empty($userdata['label'])?$userdata['label']:''));
             }
         }
 
@@ -507,4 +507,4 @@ class abook_local_file extends addressbook_backend {
     }
 
 } /* End of class abook_local_file */
-?>
\ No newline at end of file
+?>