summaryrefslogtreecommitdiffstats
path: root/lib/private/group
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-08-04 13:46:53 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-08-04 15:53:55 +0200
commitf80baf03d4003d6ac2857999ed08f82bb19071be (patch)
tree23e00a13788b3077def1e74dda04a544623a7357 /lib/private/group
parent36b0c599f5acb9c9c4b718a416051098077fbe46 (diff)
downloadnextcloud-server-f80baf03d4003d6ac2857999ed08f82bb19071be.tar.gz
nextcloud-server-f80baf03d4003d6ac2857999ed08f82bb19071be.zip
Fix getting group '0' from database backend
Fix #9972
Diffstat (limited to 'lib/private/group')
-rw-r--r--lib/private/group/database.php2
-rw-r--r--lib/private/group/manager.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/group/database.php b/lib/private/group/database.php
index baaf2cf2739..8a6cb68753c 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 dae6443e9d4..bf0910463dc 100644
--- a/lib/private/group/manager.php
+++ b/lib/private/group/manager.php
@@ -125,7 +125,7 @@ class Manager extends PublicEmitter {
* @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;