maj+ header
This commit is contained in:
@@ -402,7 +402,10 @@ class Form extends Iterator implements \Serializable
|
||||
(array) $settings,
|
||||
['name' => $post['name']]
|
||||
);
|
||||
|
||||
// Allow plugins to adapt settings for a given post name
|
||||
// Useful if schema retrieval is not an option, e.g. dynamically created forms
|
||||
$grav->fireEvent('onFormUploadSettings', new Event(['settings' => &$settings, 'post' => $post]));
|
||||
|
||||
$upload = $this->normalizeFiles($_FILES['data'], $settings->name);
|
||||
|
||||
// Handle errors and breaks without proceeding further
|
||||
@@ -699,6 +702,10 @@ class Form extends Iterator implements \Serializable
|
||||
$queue = $session->getFlashObject('files-upload');
|
||||
$queue = $queue[base64_encode($url)];
|
||||
if (is_array($queue)) {
|
||||
// Allow plugins to implement additional / alternative logic
|
||||
// Add post to event data
|
||||
$grav->fireEvent('onFormStoreUploads', new Event(['queue' => &$queue, 'form' => $this, 'post' => $post]));
|
||||
|
||||
foreach ($queue as $key => $files) {
|
||||
foreach ($files as $destination => $file) {
|
||||
if (!rename($file['tmp_name'], $destination)) {
|
||||
|
||||
Reference in New Issue
Block a user