const TYPE_PRIVATE_MESSAGE = 'm';
const TYPE_ANY_CONTACT = 'a';
- public static function rawContent()
+ public static function rawContent(array $parameters = [])
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this module.'));
'id' => intval($g['id']),
'network' => $g['network'],
'link' => $g['url'],
- 'nick' => htmlentities(defaults($g, 'attag', $g['nick'])),
- 'addr' => htmlentities(defaults($g, 'addr', $g['url'])),
+ 'nick' => htmlentities(($g['attag'] ?? '') ?: $g['nick']),
+ 'addr' => htmlentities(($g['addr'] ?? '') ?: $g['url']),
'forum' => !empty($g['forum']) || !empty($g['prv']) ? 1 : 0,
];
if ($entry['forum']) {
'id' => intval($contact['cid']),
'network' => $contact['network'],
'link' => $contact['url'],
- 'nick' => htmlentities(defaults($contact, 'nick', $contact['addr'])),
- 'addr' => htmlentities(defaults($contact, 'addr', $contact['url'])),
+ 'nick' => htmlentities(($contact['nick'] ?? '') ?: $contact['addr']),
+ 'addr' => htmlentities(($contact['addr'] ?? '') ?: $contact['url']),
'forum' => $contact['forum']
];
}