allow posted ACLs to be comma-delimited string besides the default array

This commit is contained in:
friendica 2012-11-11 13:56:21 -08:00
parent 6e0dd29c1b
commit 009744af50
3 changed files with 49 additions and 42 deletions

View file

@ -336,11 +336,18 @@ function sanitise_acl(&$item) {
// Convert an ACL array to a storable string
// Normally ACL permissions will be an array.
// We'll also allow a comma-separated string.
if(! function_exists('perms2str')) {
function perms2str($p) {
$ret = '';
$tmp = $p;
if(is_array($p))
$tmp = $p;
else
$tmp = explode(',',$p);
if(is_array($tmp)) {
array_walk($tmp,'sanitise_acl');
$ret = implode('',$tmp);