Make sure MySQL is not saying 'this' = 'this ' is true

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-03-20 15:08:21 +01:00 committed by Morris Jobke
parent b212151af1
commit 16e9bf2309
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
2 changed files with 9 additions and 1 deletions

View File

@ -52,4 +52,12 @@ class MySqlExpressionBuilder extends ExpressionBuilder {
$y = $this->helper->quoteColumnName($y); $y = $this->helper->quoteColumnName($y);
return $this->expressionBuilder->comparison($x, ' COLLATE ' . $this->charset . '_general_ci LIKE', $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);
}
} }

View File

@ -188,7 +188,7 @@ class Manager extends PublicEmitter implements IUserManager {
*/ */
public function userExists($uid) { public function userExists($uid) {
$user = $this->get($uid); $user = $this->get($uid);
return ($user !== null); return $user !== null && $user->getUID() === $uid;
} }
/** /**