Check if acls is populated before doing foreach

This commit is contained in:
Ramon Gutierrez 2018-01-12 03:14:35 +08:00
parent d8e8b94119
commit b198848a47

View file

@ -159,9 +159,13 @@ class RoleController extends BaseController
// acl attributes
$acl_attribs = $req->request->get('acl');
foreach ($acl_attribs as $acl_key)
if (!empty($acl_attribs))
{
$row->addACLAccess($acl_key);
foreach ($acl_attribs as $acl_key)
{
$row->addACLAccess($acl_key);
}
}
// validate
@ -240,9 +244,13 @@ class RoleController extends BaseController
// then add
$acl_attribs = $req->request->get('acl');
foreach ($acl_attribs as $acl_key)
if (!empty($acl_attribs))
{
$row->addACLAccess($acl_key);
foreach ($acl_attribs as $acl_key)
{
$row->addACLAccess($acl_key);
}
}
}