From: Hypolite Petovan Date: Wed, 11 Jan 2023 14:09:59 +0000 (-0500) Subject: [impressum] Avoid calling obfuscate_email on a null value X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ad04f1b6314ac462aa6af06a94344342c3557229;p=friendica-addons.git [impressum] Avoid calling obfuscate_email on a null value - Address https://github.com/friendica/friendica/issues/12486#issuecomment-1378416688 --- 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 {