Merge pull request #11455 from atm-florianm/FIX_add_hook_to_fileupload_to_enable_modules_to_override_upload_options

NEW: Add hook on fileupload.class.php to enable modules to override…
This commit is contained in:
Laurent Destailleur 2019-07-04 12:50:21 +02:00 committed by GitHub
commit 35bce50a1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,8 @@ class FileUpload
{
global $db, $conf;
global $object;
global $hookmanager;
$hookmanager->initHooks(array('fileupload'));
$this->fk_element=$fk_element;
$this->element=$element;
@ -183,6 +185,18 @@ class FileUpload
)
)
);
$hookmanager->executeHooks(
'overrideUploadOptions',
array(
'options' => &$options,
'element' => $element
),
$object,
$action,
$hookmanager
);
if ($options) {
$this->options = array_replace_recursive($this->options, $options);
}