diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-10-03 17:07:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-03 17:07:32 +0200 |
commit | 657c8da81121b272deb29a25f920280a1dc521bc (patch) | |
tree | 992cf9c5807cc8aadb0c79d88c4e633c4e38328e /lib/private/AvatarManager.php | |
parent | 62d5daa94f3bbb8cdec8a799b4f3d8178f34ec92 (diff) | |
parent | bf0371429c96ac3fad637af98bceea55374cca0e (diff) | |
download | nextcloud-server-657c8da81121b272deb29a25f920280a1dc521bc.tar.gz nextcloud-server-657c8da81121b272deb29a25f920280a1dc521bc.zip |
Merge pull request #1595 from nextcloud/fix-avatar-username
Use proper casing of username in avatar filesystem setup
Diffstat (limited to 'lib/private/AvatarManager.php')
-rw-r--r-- | lib/private/AvatarManager.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/private/AvatarManager.php b/lib/private/AvatarManager.php index 0eabc3a1754..df3247b8f00 100644 --- a/lib/private/AvatarManager.php +++ b/lib/private/AvatarManager.php @@ -92,11 +92,19 @@ class AvatarManager implements IAvatarManager { throw new \Exception('user does not exist'); } + // sanitize userID - fixes casing issue (needed for the filesystem stuff that is done below) + $userId = $user->getUID(); + /* * Fix for #22119 - * Basically we do not want to copy the skeleton folder + * Basically we do not want to copy the skeleton folder. + * + * For unit test purposes this is ignored when run in PHPUnit. */ - \OC\Files\Filesystem::initMountPoints($userId); + if(!defined('PHPUNIT_RUN')) { + \OC\Files\Filesystem::initMountPoints($userId); + } + $dir = '/' . $userId; /** @var Folder $folder */ $folder = $this->rootFolder->get($dir); |