From 187edf85aac013d808955e686899b4e2126f515a Mon Sep 17 00:00:00 2001 From: Belle Aerni Date: Sun, 24 Dec 2023 15:14:22 -0800 Subject: [PATCH] Smaller fixes (#2009) --- src/library/FOSSBilling/Tools.php | 8 +++--- src/modules/Client/Api/Guest.php | 2 +- .../Invoice/pdf_template/default-pdf.twig | 26 ++++++++++++++----- src/modules/Staff/Api/Guest.php | 2 +- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/library/FOSSBilling/Tools.php b/src/library/FOSSBilling/Tools.php index 8a9da34d9..f86471b7e 100644 --- a/src/library/FOSSBilling/Tools.php +++ b/src/library/FOSSBilling/Tools.php @@ -1,4 +1,6 @@ - 'Password required', ]; $this->di['validator']->checkRequiredParamsForArray($required, $data); - $this->di['tools']->validateAndSanitizeEmail($data['email']); + $this->di['tools']->validateAndSanitizeEmail($data['email'], true, false); $event_params = $data; $event_params['ip'] = $this->ip; diff --git a/src/modules/Invoice/pdf_template/default-pdf.twig b/src/modules/Invoice/pdf_template/default-pdf.twig index f925bc817..36272a260 100644 --- a/src/modules/Invoice/pdf_template/default-pdf.twig +++ b/src/modules/Invoice/pdf_template/default-pdf.twig @@ -4,6 +4,14 @@ {% set top = 325 + (25 * seller_lines) %} {% endif %} +{% set address_lines = [] %} + {% for line in [footer.address_1, footer.address_2, footer.address_3] %} + {% if line|length > 0 %} + {% set address_lines = address_lines|merge([line]) %} + {% endif %} + {% endfor %} +{% set address = address_lines|join(',') %} + @@ -91,12 +99,18 @@

{{ footer.signature }}

- {% if footer.display_bank_info == 1 %} - {{ 'Payment details'|trans }}:
- {{ 'Account Owner'|trans }}: {{ footer.company_name }} | {{ 'Bank'|trans }}: {{ footer.bank_name }} | {{ 'BIC / SWIFT Code'|trans }}: {{ footer.bic }} | {{ 'Account number'|trans }}: {{ footer.account_number }}

- {% endif %} - {{ footer.company_name }} {{ footer.address_1 }}, {{ footer.address_2 }}, {{ footer.address_3 }}
{{ 'Email'|trans }}: {{ footer.email }} | {{ 'Phone'|trans }}: {{ footer.phone }}
- {% if footer.company_vat %}{{ 'VAT ID'|trans }}: {{ footer.company_vat }} | {% endif %} {% if footer.company_number %} {{ 'Company Registration #:'|trans }} {{ footer.company_number }} | {% endif %} {{ 'Website'|trans }}: {{ footer.www }} + {% if footer.display_bank_info == 1 %} + {{ 'Payment details'|trans }}:
+ {{ 'Account Owner'|trans }}: {{ footer.company_name }} | {{ 'Bank'|trans }}: {{ footer.bank_name }} | {{ 'BIC / SWIFT Code'|trans }}: {{ footer.bic }} | {{ 'Account number'|trans }}: {{ footer.account_number }}

+ {% endif %} + + {{ footer.company_name }} + {% if address %} {{ address }}
{% endif %} + {{ 'Email'|trans }}: {{ footer.email }} | + {% if footer.phone %} {{ 'Phone'|trans }}: {{ footer.phone }}
{% endif %} + {% if footer.company_vat %} {{ 'VAT ID'|trans }}: {{ footer.company_vat }} | {% endif %} + {% if footer.company_number %} {{ 'Company Registration #:'|trans }} {{ footer.company_number }} | {% endif %} + {{ 'Website'|trans }}: {{ footer.www }}
diff --git a/src/modules/Staff/Api/Guest.php b/src/modules/Staff/Api/Guest.php index df414dadb..6c6d2bf94 100644 --- a/src/modules/Staff/Api/Guest.php +++ b/src/modules/Staff/Api/Guest.php @@ -66,7 +66,7 @@ class Guest extends \Api_Abstract ]; $validator = $this->di['validator']; $validator->checkRequiredParamsForArray($required, $data); - $data['email'] = $this->di['tools']->validateAndSanitizeEmail($data['email']); + $data['email'] = $this->di['tools']->validateAndSanitizeEmail($data['email'], true, false); $config = $this->getMod()->getConfig();