diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-09-26 19:44:03 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-09-26 19:44:03 -0700 |
commit | 84d2ad8ebf0ae01f9bd193cd417fef9b2da3b680 (patch) | |
tree | b6973b2db4a22b1fbc050f7511ad421d1e533a06 /boot.php | |
parent | 34eedb503acad59d649f96d3250b40cc1c84047c (diff) | |
download | volse-hubzilla-84d2ad8ebf0ae01f9bd193cd417fef9b2da3b680.tar.gz volse-hubzilla-84d2ad8ebf0ae01f9bd193cd417fef9b2da3b680.tar.bz2 volse-hubzilla-84d2ad8ebf0ae01f9bd193cd417fef9b2da3b680.zip |
cleaned up ACL expansion to remove unwanted '0' elements
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -567,15 +567,19 @@ function paginate(&$a) { if(! function_exists('expand_acl')) { function expand_acl($s) { + // turn string array of angle-bracketed elements into numeric array + // e.g. "<1><2><3>" => array(1,2,3); + $ret = array(); if(strlen($s)) { - $a = explode('<',$s); - for($x = 0; $x < count($a); $x ++) { - $a[$x] = intval(str_replace(array('<','>'),array('',''),$a[$x])); + $t = str_replace('<','',$s); + $a = explode('>',$t); + foreach($a as $aa) { + if(intval($aa)) + $ret[] = intval($aa); } - return $a; } - return array(); + return $ret; }} if(! function_exists('sanitise_acl')) { |