Fixes and type-hints:

- added more checked type-hints as they prevent bad method invocations
- fixed TypeError for HTML::toBBCode() invocations with NULL as first (wrong)
  argument, thanks to @tobias@social.diekershoff.de pointing this out.
This commit is contained in:
Roland Häder 2022-06-16 13:14:00 +02:00
parent bb57d45237
commit b1e4c0931a
No known key found for this signature in database
GPG key ID: C82EDE5DDFA0BA77
2 changed files with 19 additions and 14 deletions

View file

@ -241,9 +241,13 @@ class APContact
$apcontact['name'] = $apcontact['nick'];
}
$apcontact['about'] = HTML::toBBCode(JsonLD::fetchElement($compacted, 'as:summary', '@value'));
$aboutHtml = JsonLD::fetchElement($compacted, 'as:summary', '@value');
if ($aboutHtml != "") {
$apcontact['about'] = HTML::toBBCode($aboutHtml);
}
$ims = JsonLD::fetchElementArray($compacted, 'vcard:hasInstantMessage');
if (!empty($ims)) {
foreach ($ims as $link) {
if (substr($link, 0, 5) == 'xmpp:') {