Add missing CSRF check on avatar upload form
This commit is contained in:
@@ -30,6 +30,7 @@ class AvatarFileController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function upload()
|
public function upload()
|
||||||
{
|
{
|
||||||
|
$this->checkCSRFParam();
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
|
||||||
if (! $this->avatarFileModel->uploadImageFile($user['id'], $this->request->getFileInfo('avatar'))) {
|
if (! $this->avatarFileModel->uploadImageFile($user['id'], $this->request->getFileInfo('avatar'))) {
|
||||||
|
|||||||
@@ -13,8 +13,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<h3><?= t('Upload my avatar image') ?></h3>
|
<h3><?= t('Upload my avatar image') ?></h3>
|
||||||
<form method="post" enctype="multipart/form-data" action="<?= $this->url->href('AvatarFileController', 'upload', array('user_id' => $user['id'])) ?>">
|
<form method="post" enctype="multipart/form-data" action="<?= $this->url->href('AvatarFileController', 'upload', array('user_id' => $user['id']), true) ?>">
|
||||||
<?= $this->form->csrf() ?>
|
|
||||||
<?= $this->form->file('avatar') ?>
|
<?= $this->form->file('avatar') ?>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
|
|||||||
Reference in New Issue
Block a user