Commit fd7bcf39 authored by quicksketch's avatar quicksketch

#774304: No recursive merging of values returned by implementation of...

#774304: No recursive merging of values returned by implementation of hook_file_load() causes potential data loss.
parent fd5e3803
......@@ -142,9 +142,14 @@ function filefield_field_load($node, $field, &$items, $teaser, $page) {
while (!empty($item['data']) && is_string($item['data'])) {
$item['data'] = unserialize($item['data']);
}
// Merge any data added by modules in hook_file_load().
if (isset($file['data']) && isset($item['data'])) {
$file['data'] = array_merge((array) $item['data'], (array) $file['data']);
}
$items[$delta] = array_merge($item, $file);
}
}
return array($field['field_name'] => $items);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment