Skip to content
Snippets Groups Projects
Commit 23e70474 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #519612 by quicksketch: added drupal_function_exists() to file validators.

parent 44740785
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -1041,8 +1041,10 @@ function file_validate(&$file, $validators = array()) { ...@@ -1041,8 +1041,10 @@ 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) {
array_unshift($args, $file); if (drupal_function_exists($function)) {
$errors = array_merge($errors, call_user_func_array($function, $args)); array_unshift($args, $file);
$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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment