mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 14:48:53 +00:00
Merge pull request #3737 from javiexin/ticket/13980
[ticket/13980] Uploaded avatar not removed when new is uploaded
This commit is contained in:
commit
3768f7f2b8
1 changed files with 7 additions and 0 deletions
|
@ -161,6 +161,13 @@ class upload extends \phpbb\avatar\driver\driver
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete current avatar if not overwritten
|
||||||
|
$ext = substr(strrchr($row['avatar'], '.'), 1);
|
||||||
|
if ($ext && $ext !== $file->get('extension'))
|
||||||
|
{
|
||||||
|
$this->delete($row);
|
||||||
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'avatar' => $row['id'] . '_' . time() . '.' . $file->get('extension'),
|
'avatar' => $row['id'] . '_' . time() . '.' . $file->get('extension'),
|
||||||
'avatar_width' => $file->get('width'),
|
'avatar_width' => $file->get('width'),
|
||||||
|
|
Loading…
Add table
Reference in a new issue