aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AvatarManager.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-10-03 17:07:32 +0200
committerGitHub <noreply@github.com>2016-10-03 17:07:32 +0200
commit657c8da81121b272deb29a25f920280a1dc521bc (patch)
tree992cf9c5807cc8aadb0c79d88c4e633c4e38328e /lib/private/AvatarManager.php
parent62d5daa94f3bbb8cdec8a799b4f3d8178f34ec92 (diff)
parentbf0371429c96ac3fad637af98bceea55374cca0e (diff)
downloadnextcloud-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.php12
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);