From f2b7326650d65728619c3e3545e3ff29b1cd88ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Thu, 16 Jun 2022 15:08:04 +0200 Subject: [PATCH] This will 2 things: 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. --- src/Model/APContact.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Model/APContact.php b/src/Model/APContact.php index e99a692a18..69f9be5135 100644 --- a/src/Model/APContact.php +++ b/src/Model/APContact.php @@ -242,9 +242,7 @@ class APContact } $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');