aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--boot.php14
-rw-r--r--include/notifier.php4
-rw-r--r--mod/notifications.php2
3 files changed, 12 insertions, 8 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')) {
diff --git a/include/notifier.php b/include/notifier.php
index 2124c18e7..92f739549 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -115,7 +115,7 @@
$recipients = array_unique(array_merge($recipients,$allow_people,$allow_groups),SORT_NUMERIC);
$deny = array_unique(array_merge($deny_people,$deny_groups),SORT_NUMERIC);
$recipients = array_diff($recipients,$deny);
-
+
$conversant_str = dbesc(implode(', ',$conversants));
@@ -253,7 +253,7 @@
}
}
}
- $atom .= "</feed>\r\n";
+ $atom .= '</feed>' . "\r\n";
if($debugging)
echo $atom;
diff --git a/mod/notifications.php b/mod/notifications.php
index f38f5ae37..603c1117c 100644
--- a/mod/notifications.php
+++ b/mod/notifications.php
@@ -8,7 +8,7 @@ function notifications_post(&$a) {
$request_id = (($a->argc > 1) ? $a->argv[1] : 0);
- if($request_id == "all")
+ if($request_id === "all")
return;
if($request_id) {