Commit e35674d4 authored by Steven Wittens's avatar Steven Wittens
Browse files

Upload.module: add explicit cast to (array) for $node->files in case it's not...

Upload.module: add explicit cast to (array) for $node->files in case it's not set (e.g. nodes that don't take attachments).
parent 738dd5f3
......@@ -247,7 +247,7 @@ function upload_count_size($uid = 0) {
}
function upload_save($node) {
foreach ($node->files as $key => $file) {
foreach ((array)$node->files as $key => $file) {
if ($file->source && !$file->remove) {
// Insert new files:
$fid = db_next_id('{files}_fid');
......
......@@ -247,7 +247,7 @@ function upload_count_size($uid = 0) {
}
function upload_save($node) {
foreach ($node->files as $key => $file) {
foreach ((array)$node->files as $key => $file) {
if ($file->source && !$file->remove) {
// Insert new files:
$fid = db_next_id('{files}_fid');
......
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