Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/private/User/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@ private function loadUser($uid) {
$result = $qb->execute();
$row = $result->fetch();
$result->closeCursor();

// check proper uid case
if((string)$row['uid'] !== $uid) {
$this->cache[$uid] = false;
return false;
}

$this->cache[$uid] = false;

Expand Down
7 changes: 7 additions & 0 deletions tests/lib/User/DatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ public function testDeleteUserInvalidatesCache() {
$this->assertTrue($this->backend->userExists($user1));
}

public function testGetUserProperCaseUID() {
$user1 = $this->getUniqueID('Test_');
$this->backend->createUser($user1, 'pw');
$this->assertTrue($this->backend->userExists($user1));
$this->assertFalse($this->backend->userExists(strtolower($user1)));
}

public function testSearch() {
parent::testSearch();

Expand Down