mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-24 05:43:42 +00:00
[impressum] Avoid calling obfuscate_email on a null value
- Address https://github.com/friendica/friendica/issues/12486#issuecomment-1378416688
This commit is contained in:
parent
2724d6f5d9
commit
ad04f1b631
1 changed files with 10 additions and 11 deletions
|
@ -61,31 +61,30 @@ function impressum_load_config(App $a, ConfigFileManager $loader)
|
||||||
|
|
||||||
function impressum_show(App $a, string &$body)
|
function impressum_show(App $a, string &$body)
|
||||||
{
|
{
|
||||||
$body .= '<h3>' . DI::l10n()->t('Impressum') . '</h3>';
|
$body .= '<h3>' . DI::l10n()->t('Impressum') . '</h3>';
|
||||||
$owner = DI::config()->get('impressum', 'owner');
|
$owner = DI::config()->get('impressum', 'owner');
|
||||||
$owner_profile = DI::config()->get('impressum', 'ownerprofile');
|
$owner_profile = DI::config()->get('impressum', 'ownerprofile');
|
||||||
$postal = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'postal')));
|
$postal = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'postal')));
|
||||||
$notes = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'notes')));
|
$notes = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'notes')));
|
||||||
$email = obfuscate_email( DI::config()->get('impressum', 'email') );
|
|
||||||
|
|
||||||
if (strlen($owner)) {
|
if ($owner) {
|
||||||
if (strlen($owner_profile)) {
|
if ($owner_profile) {
|
||||||
$tmp = '<a href="' . $owner_profile . '">' . $owner . '</a>';
|
$tmp = '<a href="' . $owner_profile . '">' . $owner . '</a>';
|
||||||
} else {
|
} else {
|
||||||
$tmp = $owner;
|
$tmp = $owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($email)) {
|
if ($email = DI::config()->get('impressum', 'email')) {
|
||||||
$body .= '<p><strong>' . DI::l10n()->t('Site Owner').'</strong>: ' . $tmp .'<br /><strong>' . DI::l10n()->t('Email Address') . '</strong>: ' . $email . '</p>';
|
$body .= '<p><strong>' . DI::l10n()->t('Site Owner').'</strong>: ' . $tmp .'<br /><strong>' . DI::l10n()->t('Email Address') . '</strong>: ' . obfuscate_email($email) . '</p>';
|
||||||
} else {
|
} else {
|
||||||
$body .= '<p><strong>' . DI::l10n()->t('Site Owner').'</strong>: ' . $tmp .'</p>';
|
$body .= '<p><strong>' . DI::l10n()->t('Site Owner').'</strong>: ' . $tmp .'</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($postal)) {
|
if ($postal) {
|
||||||
$body .= '<p><strong>' . DI::l10n()->t('Postal Address') . '</strong><br />' . $postal . '</p>';
|
$body .= '<p><strong>' . DI::l10n()->t('Postal Address') . '</strong><br />' . $postal . '</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($notes)) {
|
if ($notes) {
|
||||||
$body .= '<p>' . $notes . '</p>';
|
$body .= '<p>' . $notes . '</p>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue