Avoid warnings from in_array()

This commit is contained in:
Nathan Gray 2011-05-10 14:43:16 +00:00
parent e6ecb5415c
commit a63bcaa4d3

View File

@ -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]);
}