aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2021-03-08 20:00:59 +0000
committerMax Kostikov <max@kostikov.co>2021-03-08 20:00:59 +0000
commit956aec14482bf069d7f73797c7ce364eda428e72 (patch)
tree106711ce1972a7b279fa5efc124d2b59f606430f /Zotlabs/Lib/Activity.php
parent4bcd093befaf5a1b4ee483e5d324bac1c6e57f2d (diff)
downloadvolse-hubzilla-956aec14482bf069d7f73797c7ce364eda428e72.tar.gz
volse-hubzilla-956aec14482bf069d7f73797c7ce364eda428e72.tar.bz2
volse-hubzilla-956aec14482bf069d7f73797c7ce364eda428e72.zip
Check if item have a mention
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 1963090cf..5730da934 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -980,19 +980,17 @@ class Activity {
// Returns an array of URLS for any mention tags found in the item array $i.
static function map_mentions($i) {
- if (!$i['term']) {
- return [];
- }
-
$list = [];
- foreach ($i['term'] as $t) {
- if (!$t['url']) {
- continue;
- }
- if ($t['ttype'] == TERM_MENTION) {
- $url = self::lookup_term_url($t['url']);
- $list[] = (($url) ? $url : $t['url']);
+ if (array_key_exists('term', $i) && is_array($i['term'])) {
+ foreach ($i['term'] as $t) {
+ if (!$t['url']) {
+ continue;
+ }
+ if ($t['ttype'] == TERM_MENTION) {
+ $url = self::lookup_term_url($t['url']);
+ $list[] = (($url) ? $url : $t['url']);
+ }
}
}