Skip to content
Snippets Groups Projects
Commit bb2cbf10 authored by szeidler's avatar szeidler Committed by Ronan Dowling
Browse files

Issue #2809965 by szeidler: Restore - nothing happens

parent 37f76d06
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
namespace BackupMigrate\Drupal\Filter;
use BackupMigrate\Core\Exception\BackupMigrateException;
use BackupMigrate\Core\File\BackupFileReadableInterface;
use BackupMigrate\Core\Plugin\PluginBase;
use BackupMigrate\Core\Config\Config;
......@@ -94,4 +95,19 @@ class DrupalUtils extends PluginBase {
}
}
/**
* Ensure, that the restore file does not exceed the server's upload_limit.
*
* @param BackupFileReadableInterface $file
*
* @return BackupFileReadableInterface
*/
public function beforeRestore(BackupFileReadableInterface $file) {
if ($file->getMeta('filesize') > file_upload_max_size()) {
throw new BackupMigrateException('The input file exceeds the servers upload_max_filesize or post_max_size limit.', array('!id' => $file->getMeta('id')));
}
return $file;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment