Hello,
i stumbled upon a restore bug in actual version! The issue was caused by RestoreController.php of JDownloads.
With the unfixed version i always get:
An error has occurred.
0 Joomla\Filesystem\File::upload: File not uploaded for security reasons!
After some investigations i found the reason was in RestoreController.php
Failed code:
240 // save it in temp folder
241 $upload_path = $restore_dir . '/' . File::makeSafe($file['name']);
242
243 if (!File::upload($file['tmp_name'], $upload_path)){
244 $app->enqueueMessage(Text::_('COM_JDOWNLOADS_RESTORE_MSG_STORE_ERROR'), 'error');
245 $app->redirect(ROUTE::_('index.php?option=com_jdownloads', false));
246
247 return false;
248 }
Fixed code:
240 // save it in temp folder
241 $upload_path = $restore_dir . '/' . File::makeSafe($file['name']);
242
243 if (!File::upload($file['tmp_name'], $upload_path, false, true)){
244 $app->enqueueMessage(Text::_('COM_JDOWNLOADS_RESTORE_MSG_STORE_ERROR'), 'error');
245 $app->redirect(ROUTE::_('index.php?option=com_jdownloads', false));
246
247 return false;
248 }
So line 243 had to be changed! After that the restore worked fine. 8)
Hi
Thanks for finding bug.
Just for completeness could you please advise version of Joomla and of jDownloads
Thanks
ColinM
Hey Colin,
Thanks for reply! The versions in scope are:
Joomla: 6.1.4
JDownloads: 4.1.7 Stable
Cheers
Baba