summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-08-06 09:53:13 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-08-06 09:53:13 +0200
commita72dae6842d6b550ccc8e8eb9a03f6911ae46d18 (patch)
treecb6dc9d44392498fde33db574e4835d8ad35a7d7 /lib
parent6599dc1b5ca57a8460f9e26893e3254a554e03a9 (diff)
parent4865c52aa6018c377597e2ce466cc5e60121fe61 (diff)
downloadnextcloud-server-a72dae6842d6b550ccc8e8eb9a03f6911ae46d18.tar.gz
nextcloud-server-a72dae6842d6b550ccc8e8eb9a03f6911ae46d18.zip
Merge pull request #10144 from owncloud/issue/9972
Issue/9972 Fix issues with group and username `0`
Diffstat (limited to 'lib')
-rw-r--r--lib/private/group/database.php2
-rw-r--r--lib/private/group/manager.php2
-rw-r--r--lib/private/user.php2
-rw-r--r--lib/private/user/session.php2
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/group/database.php b/lib/private/group/database.php
index b7148f38fe3..8d6ea1f50a5 100644
--- a/lib/private/group/database.php
+++ b/lib/private/group/database.php
@@ -185,7 +185,7 @@ class OC_Group_Database extends OC_Group_Backend {
public function groupExists($gid) {
$query = OC_DB::prepare('SELECT `gid` FROM `*PREFIX*groups` WHERE `gid` = ?');
$result = $query->execute(array($gid))->fetchOne();
- if ($result) {
+ if ($result !== false) {
return true;
}
return false;
diff --git a/lib/private/group/manager.php b/lib/private/group/manager.php
index 368fa3851d7..bea7ad193bf 100644
--- a/lib/private/group/manager.php
+++ b/lib/private/group/manager.php
@@ -126,7 +126,7 @@ class Manager extends PublicEmitter implements IGroupManager {
* @return \OC\Group\Group
*/
public function createGroup($gid) {
- if (!$gid) {
+ if ($gid === '' || is_null($gid)) {
return false;
} else if ($group = $this->get($gid)) {
return $group;
diff --git a/lib/private/user.php b/lib/private/user.php
index a8431af97fd..5efe205ced9 100644
--- a/lib/private/user.php
+++ b/lib/private/user.php
@@ -337,7 +337,7 @@ class OC_User {
* Checks if the user is logged in
*/
public static function isLoggedIn() {
- if (\OC::$session->get('user_id') && self::$incognitoMode === false) {
+ if (\OC::$session->get('user_id') !== null && self::$incognitoMode === false) {
return self::userExists(\OC::$session->get('user_id'));
}
return false;
diff --git a/lib/private/user/session.php b/lib/private/user/session.php
index 8c9b3e264e3..6abf8fb80d2 100644
--- a/lib/private/user/session.php
+++ b/lib/private/user/session.php
@@ -106,7 +106,7 @@ class Session implements IUserSession, Emitter {
return $this->activeUser;
} else {
$uid = $this->session->get('user_id');
- if ($uid) {
+ if ($uid !== null) {
$this->activeUser = $this->manager->get($uid);
return $this->activeUser;
} else {