mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 03:02:45 +08:00
Assert permission when updating avatar
This commit is contained in:
parent
7651907f56
commit
2eae968a70
|
@ -147,6 +147,8 @@ class EditUserHandler
|
|||
}
|
||||
|
||||
if ($avatarUrl = array_get($attributes, 'avatarUrl')) {
|
||||
$this->assertPermission($canEdit);
|
||||
|
||||
$validation = $this->validatorFactory->make(compact('avatarUrl'), ['avatarUrl' => 'url']);
|
||||
|
||||
if ($validation->fails()) {
|
||||
|
@ -161,6 +163,8 @@ class EditUserHandler
|
|||
//
|
||||
}
|
||||
} elseif (array_key_exists('avatarUrl', $attributes)) {
|
||||
$this->assertPermission($canEdit);
|
||||
|
||||
$this->avatarUploader->remove($user);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user