Skip to content

Commit

Permalink
Merge pull request #20050 from nextcloud/bugfix/noid/mysql-equal-trim…
Browse files Browse the repository at this point in the history
…s-shock

Make sure MySQL is not saying 'this' = 'this ' is true
  • Loading branch information
MorrisJobke committed Apr 15, 2020
2 parents 5c0637b + 16e9bf2 commit c43174a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,12 @@ public function iLike($x, $y, $type = null) {
$y = $this->helper->quoteColumnName($y);
return $this->expressionBuilder->comparison($x, ' COLLATE ' . $this->charset . '_general_ci LIKE', $y);
}

public function eq($x, $y, $type = null) {
return 'BINARY ' . parent::eq($x, $y, $type);
}

public function neq($x, $y, $type = null) {
return 'BINARY ' . parent::neq($x, $y, $type);
}
}
2 changes: 1 addition & 1 deletion lib/private/User/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ protected function getUserObject($uid, $backend, $cacheUser = true) {
*/
public function userExists($uid) {
$user = $this->get($uid);
return ($user !== null);
return $user !== null && $user->getUID() === $uid;
}

/**
Expand Down

0 comments on commit c43174a

Please sign in to comment.