From 18807ae21d3f18e187a524ea2dfb12830feb8ca3 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 1 Oct 2019 12:41:49 +0000 Subject: [PATCH 1/5] Don't send blank pictures on error, fail instead. --- src/Module/Proxy.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Module/Proxy.php b/src/Module/Proxy.php index 75a1142af6..6b40a498a0 100644 --- a/src/Module/Proxy.php +++ b/src/Module/Proxy.php @@ -287,14 +287,13 @@ class Proxy extends BaseModule } /** - * @brief Output a blank image, without cache headers, in case of errors + * In case of an error just stop. We don't return content to avoid caching problems * + * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ private static function responseError() { - header('Content-type: image/png'); - echo file_get_contents('images/blank.png'); - exit(); + throw new \Friendica\Network\HTTPException\InternalServerErrorException(); } /** From c494b158c896b6702984a953745969e41a147de2 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 1 Oct 2019 19:27:33 +0000 Subject: [PATCH 2/5] Fix notice "Undefined index: openRegistrations" --- src/Protocol/PortableContact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index def8f1b628..a1e6f7e21c 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -720,7 +720,7 @@ class PortableContact $server['register_policy'] = Register::CLOSED; - if (is_bool($nodeinfo['openRegistrations']) && $nodeinfo['openRegistrations']) { + if (isset($nodeinfo['openRegistrations']) && is_bool($nodeinfo['openRegistrations']) && $nodeinfo['openRegistrations']) { $server['register_policy'] = Register::OPEN; } From 8db7934a30104a55aef1f8dcabab4963acfc5db3 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 2 Oct 2019 07:33:30 +0200 Subject: [PATCH 3/5] add option 'require' for textarea form elements --- doc/smarty3-templates.md | 1 + view/templates/field_textarea.tpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/smarty3-templates.md b/doc/smarty3-templates.md index 599e3597e7..f174f21642 100644 --- a/doc/smarty3-templates.md +++ b/doc/smarty3-templates.md @@ -177,6 +177,7 @@ Field parameter: 1. Label for the input box, 2. Current text for the box, 3. Help text for the input box. +4. if set to "required" modern browser will check that this input box is filled when submitting the form, ### field_yesno.tpl diff --git a/view/templates/field_textarea.tpl b/view/templates/field_textarea.tpl index eadcbe56c7..17b07266a9 100644 --- a/view/templates/field_textarea.tpl +++ b/view/templates/field_textarea.tpl @@ -1,7 +1,7 @@
- + {{if $field.3}} {{$field.3 nofilter}} {{/if}} From 9a0201e674e7cc091a0bb669377e2b7003479eef Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 2 Oct 2019 07:39:42 +0200 Subject: [PATCH 4/5] require a note to the admin when register policy is set to needs approval --- src/Module/Register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Register.php b/src/Module/Register.php index 217581b160..d02a34a0b5 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -114,7 +114,7 @@ class Register extends BaseModule $o = Renderer::replaceMacros($tpl, [ '$invitations' => Config::get('system', 'invitation_only'), '$permonly' => intval(Config::get('config', 'register_policy')) === self::APPROVE, - '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node')], + '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node'), "required"], '$invite_desc' => L10n::t('Membership on this site is by invitation only.'), '$invite_label' => L10n::t('Your invitation code: '), '$invite_id' => $invite_id, From 92ee30959189a375ea32bccea674578b90ffe44d Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 2 Oct 2019 08:28:12 +0200 Subject: [PATCH 5/5] quotes --- src/Module/Register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Register.php b/src/Module/Register.php index d02a34a0b5..1637e0d8b6 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -114,7 +114,7 @@ class Register extends BaseModule $o = Renderer::replaceMacros($tpl, [ '$invitations' => Config::get('system', 'invitation_only'), '$permonly' => intval(Config::get('config', 'register_policy')) === self::APPROVE, - '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node'), "required"], + '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node'), 'required'], '$invite_desc' => L10n::t('Membership on this site is by invitation only.'), '$invite_label' => L10n::t('Your invitation code: '), '$invite_id' => $invite_id,