From ccb9be8f28ac3d2f7efdb7e7a14ef7956749f679 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 25 Dec 2018 12:12:59 +0000 Subject: [PATCH 1/2] Issue 6316: Do not double encode / Avoid notice --- src/Module/Contact.php | 2 +- src/Protocol/PortableContact.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Module/Contact.php b/src/Module/Contact.php index d12f003c2..fa88c0ea0 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -511,7 +511,7 @@ class Contact extends BaseModule $relation_text = ''; } - $relation_text = sprintf($relation_text, htmlentities($contact['name'])); + $relation_text = sprintf($relation_text, $contact['name']); $url = Model\Contact::magicLink($contact['url']); if (strpos($url, 'redir/') === 0) { diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index cd85c1c0a..fb7b9d7ba 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -1378,7 +1378,7 @@ class PortableContact $info = defaults($data, 'info', ''); $register_policy = defaults($data, 'register_policy', REGISTER_CLOSED); if (in_array($register_policy, ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'])) { - $register_policy = constant($data['register_policy']); + $register_policy = constant($register_policy); } else { Logger::log("Register policy '$register_policy' from $server_url is invalid."); $register_policy = REGISTER_CLOSED; // set a default value From 9feab828c88dfdc0c66fef3269f6cdf0122d2840 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 25 Dec 2018 12:30:27 +0000 Subject: [PATCH 2/2] Fixing double encoding here as well --- mod/notifications.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/notifications.php b/mod/notifications.php index 54c54fa22..00c234d15 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -237,7 +237,7 @@ function notifications_content(App $a) $notif_content[] = Renderer::replaceMacros($tpl, [ '$type' => $notif['label'], - '$header' => htmlentities($header), + '$header' => $header, '$str_notifytype' => L10n::t('Notification type:'), '$notify_type' => $notif['notify_type'], '$dfrn_text' => $dfrn_text,