aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-01-02 21:53:00 -0800
committerFriendika <info@friendika.com>2011-01-02 21:53:00 -0800
commitde5495f90b0327f565888d6cae9b9ae9cfa2664f (patch)
tree1b38154855ea59be7fa7bed5bec8f45b9fc89bf6
parent527ff13f77af4a392e93b92e51774938a5ce9885 (diff)
downloadvolse-hubzilla-de5495f90b0327f565888d6cae9b9ae9cfa2664f.tar.gz
volse-hubzilla-de5495f90b0327f565888d6cae9b9ae9cfa2664f.tar.bz2
volse-hubzilla-de5495f90b0327f565888d6cae9b9ae9cfa2664f.zip
don't process empty or non-existent group array
-rw-r--r--mod/group.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/mod/group.php b/mod/group.php
index 01875d01f..fcdc6a758 100644
--- a/mod/group.php
+++ b/mod/group.php
@@ -56,13 +56,14 @@ function group_post(&$a) {
notice( t('Group name changed.') . EOL );
}
$members = $_POST['group_members_select'];
- array_walk($members,'validate_members');
+ if(is_array($members))
+ array_walk($members,'validate_members');
$r = q("DELETE FROM `group_member` WHERE `gid` = %d AND `uid` = %d",
intval($a->argv[1]),
intval(local_user())
);
$result = true;
- if(count($members)) {
+ if(is_array($members) && count($members)) {
foreach($members as $member) {
$r = q("INSERT INTO `group_member` ( `uid`, `gid`, `contact-id`)
VALUES ( %d, %d, %d )",