// Call the validation functions.
$errors = array();
foreach ($validators as $function => $args) {
- array_unshift($args, $file);
+ // Add the $file variable to the list of arguments and pass it by
+ // reference (required for PHP 5.3 and higher).
+ array_unshift($args, NULL);
+ $args[0] = &$file;
$errors = array_merge($errors, call_user_func_array($function, $args));
}