diff options
author | Max Kostikov <max@kostikov.co> | 2021-03-08 20:00:59 +0000 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2021-03-08 20:00:59 +0000 |
commit | 956aec14482bf069d7f73797c7ce364eda428e72 (patch) | |
tree | 106711ce1972a7b279fa5efc124d2b59f606430f /Zotlabs/Lib/Activity.php | |
parent | 4bcd093befaf5a1b4ee483e5d324bac1c6e57f2d (diff) | |
download | volse-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.php | 20 |
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']); + } } } |