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