]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure MySQL is not saying 'this' = 'this ' is true 20050/head
authorJoas Schilling <coding@schilljs.com>
Fri, 20 Mar 2020 14:08:21 +0000 (15:08 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Wed, 15 Apr 2020 07:14:12 +0000 (09:14 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php
lib/private/User/Manager.php

index 899f9277439305dbd2938118f561e6b98b494940..3b81f11c4dc5bb735d4095f0556053121d8ad9a4 100644 (file)
@@ -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);
+       }
 }
index 303050a7716f3a03f95496dca723eb9fe6c6f34a..e55d439519197d5299a63a873170fccafabb49b1 100644 (file)
@@ -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;
        }
 
        /**