make sure we have an array

This commit is contained in:
Mario
2022-02-11 12:59:08 +00:00
parent d65052c1ac
commit d45e8e4d20

View File

@@ -608,10 +608,10 @@ class Activity {
$ptr = [$ptr];
}
foreach ($ptr as $t) {
if (!array_key_exists('type', $t))
if (is_array($t) && !array_key_exists('type', $t))
$t['type'] = 'Hashtag';
if (array_key_exists('href', $t) && array_key_exists('name', $t)) {
if (is_array($t) && 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'])];