Refactor Pico::parseFileMeta()

This commit is contained in:
Daniel Rudolf 2015-11-29 21:58:30 +01:00
parent 6cb378e83f
commit 9aaab5de1a

View file

@ -772,7 +772,7 @@ class Pico
$meta[$fieldId] = $meta[$fieldName];
unset($meta[$fieldName]);
}
} else {
} elseif (!isset($meta[$fieldId])) {
// guarantee array key existance
$meta[$fieldId] = '';
}
@ -786,10 +786,7 @@ class Pico
}
} else {
// guarantee array key existance
foreach ($headers as $id => $field) {
$meta[$id] = '';
}
$meta = array_fill_keys(array_keys($headers), '');
$meta['time'] = $meta['date_formatted'] = '';
}