Smaller fixes (#2009)

This commit is contained in:
Belle Aerni authored and GitHub committed 2023-12-24 23:14:22 +00:00
1 parent e556eea28e
commit 187edf85aa
4 files changed
+27 -11

No files matched your search

+5 -3
View File
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
/**
* Copyright 2022-2023 FOSSBilling
* Copyright 2011-2021 BoxBilling, Inc.
@@ -280,12 +282,12 @@ class Tools
* In a production environment, this will both check that the email address matches RFC standards as well as validating the domain.
* In a testing / development environment it will only check the RFC standards.
*/
public function validateAndSanitizeEmail(string $email, bool $throw = true)
public function validateAndSanitizeEmail(string $email, bool $throw = true, bool $checkDNS = true)
{
$email = htmlspecialchars($email);
$validator = new EmailValidator();
if (Environment::isProduction()) {
if (Environment::isProduction() && $checkDNS) {
$validations = new MultipleValidationWithAnd([
new RFCValidation(),
new DNSCheckValidation()
+1 -1
View File
@@ -115,7 +115,7 @@ class Guest extends \Api_Abstract
'password' => '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;
@@ -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(',') %}
<!DOCTYPE html>
<html>
<head>
@@ -91,12 +99,18 @@
<p>{{ footer.signature }}</p>
</div>
<div class='InvoiceFooter'>
{% if footer.display_bank_info == 1 %}
<b>{{ 'Payment details'|trans }}:</b><br >
<b>{{ 'Account Owner'|trans }}:</b> {{ footer.company_name }} | <b>{{ 'Bank'|trans }}:</b> {{ footer.bank_name }} | <b>{{ 'BIC / SWIFT Code'|trans }}:</b> {{ footer.bic }} | <b>{{ 'Account number'|trans }}:</b> {{ footer.account_number }}<br><br>
{% endif %}
<b>{{ footer.company_name }}</b> {{ footer.address_1 }}, {{ footer.address_2 }}, {{ footer.address_3 }} <br ><b>{{ 'Email'|trans }}:</b> {{ footer.email }} | <b>{{ 'Phone'|trans }}:</b> {{ footer.phone }}<br>
{% if footer.company_vat %}<b>{{ 'VAT ID'|trans }}:</b> {{ footer.company_vat }} | {% endif %} {% if footer.company_number %} <b>{{ 'Company Registration #:'|trans }}</b> {{ footer.company_number }} | {% endif %} <b>{{ 'Website'|trans }}: </b>{{ footer.www }}
{% if footer.display_bank_info == 1 %}
<b>{{ 'Payment details'|trans }}:</b><br >
<b>{{ 'Account Owner'|trans }}:</b> {{ footer.company_name }} | <b>{{ 'Bank'|trans }}:</b> {{ footer.bank_name }} | <b>{{ 'BIC / SWIFT Code'|trans }}:</b> {{ footer.bic }} | <b>{{ 'Account number'|trans }}:</b> {{ footer.account_number }}<br><br>
{% endif %}
<b>{{ footer.company_name }}</b>
{% if address %} {{ address }} <br> {% endif %}
<b>{{ 'Email'|trans }}:</b> {{ footer.email }} | <b>
{% if footer.phone %} {{ 'Phone'|trans }}:</b> {{ footer.phone }}<br> {% endif %}
{% if footer.company_vat %} <b>{{ 'VAT ID'|trans }}:</b> {{ footer.company_vat }} | {% endif %}
{% if footer.company_number %} <b>{{ 'Company Registration #:'|trans }}</b> {{ footer.company_number }} | {% endif %}
<b>{{ 'Website'|trans }}: </b>{{ footer.www }}
</div>
</body>
</html>
+1 -1
View File
@@ -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();