Fix getting group '0' from database backend

Fix #9972
remotes/origin/fix-10825
Joas Schilling 11 years ago
parent 36b0c599f5
commit f80baf03d4
  1. 2
      lib/private/group/database.php
  2. 2
      lib/private/group/manager.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;

@ -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;

Loading…
Cancel
Save