Skip to content

Commit

Permalink
Tweak for new AJAX upload handling
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Aug 16, 2021
1 parent a7fa583 commit cb0942d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion libraries/fabrik/fabrik/Helpers/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ public static function canUpload($file, &$err, &$params)
return false;
}

if (!is_uploaded_file($file['tmp_name']))
/**
* If we're AJAX uploading and WiP is set, don't check is_uploaded_file, because it won't be,
* we uploaded it direct from the form through AJAX to our own tmp location, now we're just moving it
*/
if (!($params->get('ajax_upload', '0') === '1' && $params->get('upload_use_wip', '0') === '1') && !is_uploaded_file($file['tmp_name']))
{
// Handle potential malicious attack
$err = Text::_('File has not been uploaded');
Expand Down
2 changes: 1 addition & 1 deletion plugins/fabrik_element/image/image-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb0942d

Please sign in to comment.