=== modified file 'sites/all/modules/filefield/field_file.inc'
--- sites/all/modules/filefield/field_file.inc	2010-07-01 14:24:51 +0000
+++ sites/all/modules/filefield/field_file.inc	2010-07-28 13:19:02 +0000
@@ -156,7 +156,11 @@ function field_file_save_file($filepath,
   // Call the validation functions.
   $errors = array();
   foreach ($validators as $function => $args) {
-    array_unshift($args, $file);
+    // We have to pass $file as a reference explicitly (because
+    // call_user_func_array() ignores function definitions),
+    // but we cant't safely call array_unshift() with a reference, so:
+    array_unshift($args, NULL);
+    $args[0] = &$file;
     $errors = array_merge($errors, call_user_func_array($function, $args));
   }
 

