]> git.mxchange.org Git - friendica.git/blob - src/Protocol/Activity.php
64253b0652ecba91226a6305de401d61e81be93d
[friendica.git] / src / Protocol / Activity.php
1 <?php
2
3 namespace Friendica\Protocol;
4
5 /**
6  * Base class for the Activity namespace
7  */
8 final class Activity
9 {
10         /**
11          * Compare activity uri. Knows about activity namespace.
12          *
13          * @param string $haystack
14          * @param string $needle
15          *
16          * @return boolean
17          */
18         public function match(string $haystack, string $needle) {
19                 return (($haystack === $needle) ||
20                         ((basename($needle) === $haystack) &&
21                          strstr($needle, NAMESPACE_ACTIVITY_SCHEMA)));
22         }
23 }