- Patch #519612 by quicksketch: added drupal_function_exists() to file validators.
parent
44740785fe
commit
23e704747d
|
@ -1041,9 +1041,11 @@ function file_validate(&$file, $validators = array()) {
|
||||||
// Call the validation functions specified by this function's caller.
|
// Call the validation functions specified by this function's caller.
|
||||||
$errors = array();
|
$errors = array();
|
||||||
foreach ($validators as $function => $args) {
|
foreach ($validators as $function => $args) {
|
||||||
|
if (drupal_function_exists($function)) {
|
||||||
array_unshift($args, $file);
|
array_unshift($args, $file);
|
||||||
$errors = array_merge($errors, call_user_func_array($function, $args));
|
$errors = array_merge($errors, call_user_func_array($function, $args));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Let other modules perform validation on the new file.
|
// Let other modules perform validation on the new file.
|
||||||
return array_merge($errors, module_invoke_all('file_validate', $file));
|
return array_merge($errors, module_invoke_all('file_validate', $file));
|
||||||
|
|
Loading…
Reference in New Issue