diff --git a/lib/user/database.php b/lib/user/database.php index 210c7f3e1e..ea938790d2 100644 --- a/lib/user/database.php +++ b/lib/user/database.php @@ -237,13 +237,13 @@ class OC_User_Database extends OC_User_Backend { * @return boolean */ public function userExists($uid) { - $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' ); + $query = OC_DB::prepare( 'SELECT COUNT(*) FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' ); $result = $query->execute( array( $uid )); if (OC_DB::isError($result)) { OC_Log::write('core', OC_DB::getErrorMessage($result), OC_Log::ERROR); return false; } - return $result->numRows() > 0; + return $result->fetchOne() > 0; } /**