Sinc we use AppData the regex is not needed anymore
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
ba648eecdf
commit
03d9e7e963
1 changed files with 1 additions and 4 deletions
|
@ -146,16 +146,13 @@ class Avatar implements IAvatar {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function remove () {
|
public function remove () {
|
||||||
$regex = '/^avatar\.([0-9]+\.)?(jpg|png)$/';
|
|
||||||
$avatars = $this->folder->getDirectoryListing();
|
$avatars = $this->folder->getDirectoryListing();
|
||||||
|
|
||||||
$this->config->setUserValue($this->user->getUID(), 'avatar', 'version',
|
$this->config->setUserValue($this->user->getUID(), 'avatar', 'version',
|
||||||
(int)$this->config->getUserValue($this->user->getUID(), 'avatar', 'version', 0) + 1);
|
(int)$this->config->getUserValue($this->user->getUID(), 'avatar', 'version', 0) + 1);
|
||||||
|
|
||||||
foreach ($avatars as $avatar) {
|
foreach ($avatars as $avatar) {
|
||||||
if (preg_match($regex, $avatar->getName())) {
|
$avatar->delete();
|
||||||
$avatar->delete();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$this->user->triggerChange('avatar', '');
|
$this->user->triggerChange('avatar', '');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue