From a63bcaa4d341f8eb364e4dba02fd0ade0f2f8065 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 10 May 2011 14:43:16 +0000 Subject: [PATCH] Avoid warnings from in_array() --- importexport/inc/class.importexport_import_csv.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/importexport/inc/class.importexport_import_csv.inc.php b/importexport/inc/class.importexport_import_csv.inc.php index b5ca42d354..b9f814124e 100755 --- a/importexport/inc/class.importexport_import_csv.inc.php +++ b/importexport/inc/class.importexport_import_csv.inc.php @@ -305,7 +305,8 @@ class importexport_import_csv implements importexport_iface_import_record { //, foreach((array)$fields['date-time'] as $name) { if ($record[$name] && !is_numeric($record[$name])) { $record[$name] = egw_time::user2server($record[$name],'ts'); - if(in_array($name, self::$cf_parse_cache[$appname][0]['date-time'])) { + if(is_array(self::$cf_parse_cache[$appname][0]['date-time']) && + in_array($name, self::$cf_parse_cache[$appname][0]['date-time'])) { // Custom fields stored in a particular format (from customfields_widget) $record[$name] = date('Y-m-d H:i:s', $record[$name]); } @@ -314,7 +315,8 @@ class importexport_import_csv implements importexport_iface_import_record { //, foreach((array)$fields['date'] as $name) { if ($record[$name] && !is_numeric($record[$name])) { $record[$name] = egw_time::user2server($record[$name],'ts'); - if(in_array($name, self::$cf_parse_cache[$appname][0]['date'])) { + if(is_array(self::$cf_parse_cache[$appname][0]['date']) && + in_array($name, self::$cf_parse_cache[$appname][0]['date'])) { // Custom fields stored in a particular format (from customfields_widget) $record[$name] = date('Y-m-d', $record[$name]); }