diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-04-15 12:57:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 12:57:27 +0200 |
commit | c43174a7e67bba88f13d777d29801d9bccdc133e (patch) | |
tree | 5f4846baa1bbee25d3916d207a242723a5cc2595 | |
parent | 5c0637bc90f9dbef088755b901a4a068dcd5d469 (diff) | |
parent | 16e9bf23094a218d01d6b87b22e358473af1e731 (diff) | |
download | nextcloud-server-c43174a7e67bba88f13d777d29801d9bccdc133e.tar.gz nextcloud-server-c43174a7e67bba88f13d777d29801d9bccdc133e.zip |
Merge pull request #20050 from nextcloud/bugfix/noid/mysql-equal-trims-shock
Make sure MySQL is not saying 'this' = 'this ' is true
-rw-r--r-- | lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php | 8 | ||||
-rw-r--r-- | lib/private/User/Manager.php | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php index 899f9277439..3b81f11c4dc 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php @@ -52,4 +52,12 @@ class MySqlExpressionBuilder extends ExpressionBuilder { $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); + } } diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 303050a7716..e55d4395191 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -188,7 +188,7 @@ class Manager extends PublicEmitter implements IUserManager { */ public function userExists($uid) { $user = $this->get($uid); - return ($user !== null); + return $user !== null && $user->getUID() === $uid; } /** |