From ad04f1b6314ac462aa6af06a94344342c3557229 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 11 Jan 2023 09:09:59 -0500 Subject: [PATCH] [impressum] Avoid calling obfuscate_email on a null value - Address https://github.com/friendica/friendica/issues/12486#issuecomment-1378416688 --- impressum/impressum.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/impressum/impressum.php b/impressum/impressum.php index d7298cb8..52c91de0 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -61,31 +61,30 @@ function impressum_load_config(App $a, ConfigFileManager $loader) function impressum_show(App $a, string &$body) { - $body .= '

' . DI::l10n()->t('Impressum') . '

'; - $owner = DI::config()->get('impressum', 'owner'); + $body .= '

' . DI::l10n()->t('Impressum') . '

'; + $owner = DI::config()->get('impressum', 'owner'); $owner_profile = DI::config()->get('impressum', 'ownerprofile'); - $postal = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'postal'))); - $notes = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'notes'))); - $email = obfuscate_email( DI::config()->get('impressum', 'email') ); + $postal = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'postal'))); + $notes = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'notes'))); - if (strlen($owner)) { - if (strlen($owner_profile)) { + if ($owner) { + if ($owner_profile) { $tmp = '' . $owner . ''; } else { $tmp = $owner; } - if (strlen($email)) { - $body .= '

' . DI::l10n()->t('Site Owner').': ' . $tmp .'
' . DI::l10n()->t('Email Address') . ': ' . $email . '

'; + if ($email = DI::config()->get('impressum', 'email')) { + $body .= '

' . DI::l10n()->t('Site Owner').': ' . $tmp .'
' . DI::l10n()->t('Email Address') . ': ' . obfuscate_email($email) . '

'; } else { $body .= '

' . DI::l10n()->t('Site Owner').': ' . $tmp .'

'; } - if (strlen($postal)) { + if ($postal) { $body .= '

' . DI::l10n()->t('Postal Address') . '
' . $postal . '

'; } - if (strlen($notes)) { + if ($notes) { $body .= '

' . $notes . '

'; } } else { -- 2.43.5