fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [17589]


From: nelson . guerra
Subject: [Fmsystem-commits] [17589]
Date: Mon, 15 Jan 2018 20:52:57 -0500 (EST)

Revision: 17589
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17589
Author:   nelson224
Date:     2018-01-15 20:52:57 -0500 (Mon, 15 Jan 2018)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind/addressbook/inc/class.ipc_addressbook.inc.php

Modified: branches/dev-syncromind/addressbook/inc/class.ipc_addressbook.inc.php
===================================================================
--- branches/dev-syncromind/addressbook/inc/class.ipc_addressbook.inc.php       
2018-01-16 01:52:37 UTC (rev 17588)
+++ branches/dev-syncromind/addressbook/inc/class.ipc_addressbook.inc.php       
2018-01-16 01:52:57 UTC (rev 17589)
@@ -64,8 +64,11 @@
                        $buffer = array();
                        $temp_line = '';
 
-                       while(list(, $line) = each($data_lines))
-                       {
+                       //while(list(, $line) = each($data_lines))
+                        if (is_array($data_lines))
+                        {
+                            foreach($data_lines as $key => $line)
+                            {
                                $line = trim($line);
                                if(substr($line, -1) == '=')
                                {
@@ -86,7 +89,8 @@
                                }
 
                                $buffer += 
$this->vcard->parse_vcard_line($line);
-                       }
+                            }
+                        }
 
                        $fields = $this->vcard->in($buffer);
                        $fields['owner'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
@@ -170,8 +174,9 @@
                        {
                                // locations[loc_id][type] is work or home
                                // loc_id is not  interested here, but the type 
is important!
-                               while ( list($loc_id, $loc_data) = 
each($fieldlist['locations']) )
-                               {
+                               //while ( list($loc_id, $loc_data) = 
each($fieldlist['locations']) )
+                                foreach($fieldlist['locations'] as $loc_id => 
$loc_data)
+                                {
                                        $loc_type_id = 
$this->contacts->search_location_type($loc_data['type']);
                                        switch($loc_type_id)
                                        {
@@ -191,7 +196,7 @@
                                        $fields[$adr.'region']       = 
$loc_data['state'];
                                        $fields[$adr.'postalcode']       = 
$loc_data['postal_code'];
                                        $fields[$adr.'countryname']      = 
$loc_data['country'];
-                               }
+                                }
                        }
 
                        $fields['tel_work']             = 
$fieldlist['comm_media']['work phone'];
@@ -228,14 +233,18 @@
                        $myexport = $this->vcard->export;
                        // check that each $fields exists in the export array 
and
                        // set a new array to equal the translation and 
original value
-                       while( list($name,$value) = each($fields) )
-                       {
+                       //while( list($name,$value) = each($fields) )
+                        if (is_array($fields))
+                        {
+                            foreach($fields as $name => $value)
+                            {
                                if ($myexport[$name] && ($value != "") )
                                {
                                        //echo '<br 
/>'.$name."=".$fields[$name]."\n";
                                        $buffer[$myexport[$name]] = $value;
                                }
-                       }
+                            }
+                        }
 
                        // create a vcard from this translated array
                        $data = $this->vcard->out($buffer);
@@ -340,8 +349,11 @@
                        $buffer = array();
                        $temp_line = '';
 
-                       while(list(, $line) = each($data_lines))
-                       {
+                       //while(list(, $line) = each($data_lines))
+                        if (is_array($data_lines))
+                        {
+                            foreach($data_lines as $key => $line)
+                            {
                                $line = trim($line);
                                if(substr($line, -1) == '=')
                                {
@@ -362,7 +374,8 @@
                                }
 
                                $buffer += 
$this->vcard->parse_vcard_line($line);
-                       }
+                            }
+                        }
 
                        $fields = $this->vcard->in($buffer);
                        $fields['owner'] = 
$GLOBALS['phpgw_info']['user']['account_id'];




reply via email to

[Prev in Thread] Current Thread [Next in Thread]