1) The first change prevents "expensive" code in HTML::toBBcode() to be executed
just for an empty string which makes no sense.
2) The above change was maybe flawed as $apcontact['about'] would have never
been created, not even empty which could have side effects
Thanks to @annando to make me rethink this part of code.
}
$aboutHtml = JsonLD::fetchElement($compacted, 'as:summary', '@value');
- if ($aboutHtml != "") {
- $apcontact['about'] = HTML::toBBCode($aboutHtml);
- }
+ $apcontact['about'] = (!empty($aboutHtml) ? HTML::toBBCode($aboutHtml) : '');
$ims = JsonLD::fetchElementArray($compacted, 'vcard:hasInstantMessage');