diff options
author | zotlabs <mike@macgirvin.com> | 2017-09-24 22:41:14 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-09-24 22:41:14 -0700 |
commit | 741af8c1644a16f1ec44064090013953232bdce9 (patch) | |
tree | 07c1a2ddb752a087344d8844967c5888d7e03bca | |
parent | 137f5b3dbc05b35bc1a05c8d2b34abed0ebd2e9b (diff) | |
download | volse-hubzilla-741af8c1644a16f1ec44064090013953232bdce9.tar.gz volse-hubzilla-741af8c1644a16f1ec44064090013953232bdce9.tar.bz2 volse-hubzilla-741af8c1644a16f1ec44064090013953232bdce9.zip |
extend activity_match to work with arrays
-rw-r--r-- | include/text.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php index baac58e50..bd802b2c1 100644 --- a/include/text.php +++ b/include/text.php @@ -761,9 +761,17 @@ function profiler($t1,$t2,$label) { function activity_match($haystack,$needle) { - if(($haystack === $needle) || ((basename($needle) === $haystack) && strstr($needle,NAMESPACE_ACTIVITY_SCHEMA))) - return true; + if(! is_array($needle)) + $needle = [ $needle ]; + + if($needle) { + foreach($needle as $n) { + if(($haystack === $n) || (strtolower(basename($n)) === strtolower(basename($haystack)))) { + return true; + } + } + } return false; } |