cleaned up ACL expansion to remove unwanted '0' elements
This commit is contained in:
parent
34eedb503a
commit
84d2ad8ebf
3 changed files with 12 additions and 8 deletions
14
boot.php
14
boot.php
|
@ -567,15 +567,19 @@ function paginate(&$a) {
|
||||||
|
|
||||||
if(! function_exists('expand_acl')) {
|
if(! function_exists('expand_acl')) {
|
||||||
function expand_acl($s) {
|
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)) {
|
if(strlen($s)) {
|
||||||
$a = explode('<',$s);
|
$t = str_replace('<','',$s);
|
||||||
for($x = 0; $x < count($a); $x ++) {
|
$a = explode('>',$t);
|
||||||
$a[$x] = intval(str_replace(array('<','>'),array('',''),$a[$x]));
|
foreach($a as $aa) {
|
||||||
|
if(intval($aa))
|
||||||
|
$ret[] = intval($aa);
|
||||||
}
|
}
|
||||||
return $a;
|
|
||||||
}
|
}
|
||||||
return array();
|
return $ret;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
if(! function_exists('sanitise_acl')) {
|
if(! function_exists('sanitise_acl')) {
|
||||||
|
|
|
@ -253,7 +253,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$atom .= "</feed>\r\n";
|
$atom .= '</feed>' . "\r\n";
|
||||||
|
|
||||||
if($debugging)
|
if($debugging)
|
||||||
echo $atom;
|
echo $atom;
|
||||||
|
|
|
@ -8,7 +8,7 @@ function notifications_post(&$a) {
|
||||||
|
|
||||||
$request_id = (($a->argc > 1) ? $a->argv[1] : 0);
|
$request_id = (($a->argc > 1) ? $a->argv[1] : 0);
|
||||||
|
|
||||||
if($request_id == "all")
|
if($request_id === "all")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if($request_id) {
|
if($request_id) {
|
||||||
|
|
Loading…
Reference in a new issue