[AVATAR] Try to delete tmp avatar if something goes wrong during the process
This commit is contained in:
parent
5439ff3ec5
commit
44ad0d3a85
|
@ -112,6 +112,11 @@ class AvatarsettingsAction extends SettingsAction
|
||||||
|
|
||||||
public function showUploadForm()
|
public function showUploadForm()
|
||||||
{
|
{
|
||||||
|
// If we detect that the user didn't finish setting a new avatar, remove the temporary file.
|
||||||
|
if (isset($_SESSION['FILEDATA'])) {
|
||||||
|
@unlink($_SESSION['FILEDATA']['filepath']);
|
||||||
|
unset($_SESSION['FILEDATA']);
|
||||||
|
}
|
||||||
$this->elementStart('form', ['enctype' => 'multipart/form-data',
|
$this->elementStart('form', ['enctype' => 'multipart/form-data',
|
||||||
'method' => 'post',
|
'method' => 'post',
|
||||||
'id' => 'form_settings_avatar',
|
'id' => 'form_settings_avatar',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user