aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-09-26 19:44:03 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-09-26 19:44:03 -0700
commit84d2ad8ebf0ae01f9bd193cd417fef9b2da3b680 (patch)
treeb6973b2db4a22b1fbc050f7511ad421d1e533a06 /boot.php
parent34eedb503acad59d649f96d3250b40cc1c84047c (diff)
downloadvolse-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.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/boot.php b/boot.php
index 956f2f466..c7b694dd5 100644
--- a/boot.php
+++ b/boot.php
@@ -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')) {