Add missing CSRF check in saveUploadDB() method
This commit is contained in:
@@ -199,6 +199,7 @@ class ConfigController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function saveUploadedDb()
|
public function saveUploadedDb()
|
||||||
{
|
{
|
||||||
|
$this->checkCSRFParam();
|
||||||
$filename = $this->request->getFilePath('file');
|
$filename = $this->request->getFilePath('file');
|
||||||
|
|
||||||
if (!file_exists($filename) || !$this->configModel->uploadDatabase($filename)) {
|
if (!file_exists($filename) || !$this->configModel->uploadDatabase($filename)) {
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="<?= $this->url->href('ConfigController', 'saveUploadedDb') ?>" method="post" enctype="multipart/form-data">
|
<form action="<?= $this->url->href('ConfigController', 'saveUploadedDb', [], true) ?>" method="post" enctype="multipart/form-data">
|
||||||
<?= $this->form->csrf() ?>
|
|
||||||
|
|
||||||
<?= $this->form->label(t('Database file'), 'file') ?>
|
<?= $this->form->label(t('Database file'), 'file') ?>
|
||||||
<?= $this->form->file('file') ?>
|
<?= $this->form->file('file') ?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user