From 741af8c1644a16f1ec44064090013953232bdce9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 24 Sep 2017 22:41:14 -0700 Subject: extend activity_match to work with arrays --- include/text.php | 12 ++++++++++-- 1 file 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; } -- cgit v1.2.3