mirror of
https://github.com/friendica/friendica
synced 2025-04-27 14:30:11 +00:00
allow posted ACLs to be comma-delimited string besides the default array
This commit is contained in:
parent
6e0dd29c1b
commit
009744af50
3 changed files with 49 additions and 42 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue