summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/file.inc3
-rw-r--r--modules/upload.module1
-rw-r--r--modules/upload/upload.module1
3 files changed, 4 insertions, 1 deletions
diff --git a/includes/file.inc b/includes/file.inc
index dbd981bb2..91aa484f1 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -131,7 +131,8 @@ function file_check_path(&$path) {
}
/**
- * Check if $source is a valid file upload.
+ * Check if $source is a valid file upload. If so, process $_FILES
+ * and return its contents as an object.
*
* @param $source
*/
diff --git a/modules/upload.module b/modules/upload.module
index 1da1bc128..d5c7a49bd 100644
--- a/modules/upload.module
+++ b/modules/upload.module
@@ -190,6 +190,7 @@ function upload_nodeapi(&$node, $op, $arg) {
// Double check existing files:
if (is_array($node->list)) {
foreach ($node->list as $key => $value) {
+ // Ensure file is valid and retrieve contents of $_FILES array
if ($file = file_check_upload($key)) {
$node->files[$file->source] = $file;
$node->files[$key]->list = $node->list[$key];
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index 1da1bc128..d5c7a49bd 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -190,6 +190,7 @@ function upload_nodeapi(&$node, $op, $arg) {
// Double check existing files:
if (is_array($node->list)) {
foreach ($node->list as $key => $value) {
+ // Ensure file is valid and retrieve contents of $_FILES array
if ($file = file_check_upload($key)) {
$node->files[$file->source] = $file;
$node->files[$key]->list = $node->list[$key];