Merge pull request #23641 from owncloud/avatar-remove-9
[9.0] only remove avatars from the folder we store them in
This commit is contained in:
commit
2ab503f70a
|
@ -134,7 +134,7 @@ class Avatar implements IAvatar {
|
|||
*/
|
||||
public function remove () {
|
||||
$regex = '/^avatar\.([0-9]+\.)?(jpg|png)$/';
|
||||
$avatars = $this->folder->search('avatar');
|
||||
$avatars = $this->folder->getDirectoryListing();
|
||||
|
||||
foreach ($avatars as $avatar) {
|
||||
if (preg_match($regex, $avatar->getName())) {
|
||||
|
|
|
@ -148,8 +148,7 @@ class AvatarTest extends \Test\TestCase {
|
|||
->willReturn('avatarX');
|
||||
$nonAvatarFile->expects($this->never())->method('delete');
|
||||
|
||||
$this->folder->method('search')
|
||||
->with('avatar')
|
||||
$this->folder->method('getDirectoryListing')
|
||||
->willReturn([$avatarFileJPG, $avatarFilePNG, $resizedAvatarFile, $nonAvatarFile]);
|
||||
|
||||
$newFile = $this->getMock('\OCP\Files\File');
|
||||
|
|
Loading…
Reference in New Issue