From c998006b2cfd5daedb3bc149fbcc553897858b16 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 3 Nov 2008 13:48:04 +0000 Subject: [PATCH] MINOR Fixed PHP Notices in Member.php git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65146 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- security/Member.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/Member.php b/security/Member.php index e185245be..7514f361e 100644 --- a/security/Member.php +++ b/security/Member.php @@ -527,7 +527,7 @@ class Member extends DataObject { * @return bool Returns TRUE if the member is in one of the given groups, otherwise FALSE. */ public function inGroups($groups, $strict = false) { - foreach($groups as $group) { + if($groups) foreach($groups as $group) { if($this->inGroup($group, $strict)) return true; } @@ -555,7 +555,7 @@ class Member extends DataObject { } $groupCandidateObjs = ($strict) ? $this->getManyManyComponents("Groups") : $this->Groups(); - foreach($groupCandidateObjs as $groupCandidateObj) { + if($groupCandidateObjs) foreach($groupCandidateObjs as $groupCandidateObj) { if($groupCandidateObj->ID == $groupCheckObj->ID) return true; }