aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2021-03-08 20:35:03 +0000
committerMax Kostikov <max@kostikov.co>2021-03-08 20:35:03 +0000
commit5d82bf946e10ce2bc29935977b17987a3bb84b07 (patch)
treea873e9fea73270b039d8a915e259344cd38e0f2e
parentc8fe56e57d22373f34ebc62849ffcd74dc08fd09 (diff)
downloadvolse-hubzilla-5d82bf946e10ce2bc29935977b17987a3bb84b07.tar.gz
volse-hubzilla-5d82bf946e10ce2bc29935977b17987a3bb84b07.tar.bz2
volse-hubzilla-5d82bf946e10ce2bc29935977b17987a3bb84b07.zip
Check if properties were provided on taxonomy decode
-rw-r--r--Zotlabs/Lib/Activity.php32
1 files changed, 17 insertions, 15 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 27fd4906e..d28f5631d 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -582,23 +582,25 @@ class Activity {
if (!array_key_exists('type', $t))
$t['type'] = 'Hashtag';
- switch ($t['type']) {
- case 'Hashtag':
- $ret[] = ['ttype' => TERM_HASHTAG, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'], 0, 1) === '#') ? substr($t['name'], 1) : $t['name'])];
- break;
+ if (array_key_exists('href', $t) && array_key_exists('name', $t)) {
+ switch ($t['type']) {
+ case 'Hashtag':
+ $ret[] = ['ttype' => TERM_HASHTAG, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'], 0, 1) === '#') ? substr($t['name'], 1) : $t['name'])];
+ break;
- case 'Mention':
- $mention_type = substr($t['name'], 0, 1);
- if ($mention_type === '!') {
- $ret[] = ['ttype' => TERM_FORUM, 'url' => $t['href'], 'term' => escape_tags(substr($t['name'], 1))];
- }
- else {
- $ret[] = ['ttype' => TERM_MENTION, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'], 0, 1) === '@') ? substr($t['name'], 1) : $t['name'])];
- }
- break;
+ case 'Mention':
+ $mention_type = substr($t['name'], 0, 1);
+ if ($mention_type === '!') {
+ $ret[] = ['ttype' => TERM_FORUM, 'url' => $t['href'], 'term' => escape_tags(substr($t['name'], 1))];
+ }
+ else {
+ $ret[] = ['ttype' => TERM_MENTION, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'], 0, 1) === '@') ? substr($t['name'], 1) : $t['name'])];
+ }
+ break;
- default:
- break;
+ default:
+ break;
+ }
}
}
}