]> git.mxchange.org Git - friendica.git/commitdiff
Changes:
authorRoland Häder <roland@mxchange.org>
Mon, 26 Sep 2022 08:20:56 +0000 (10:20 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 23 Jun 2025 20:54:01 +0000 (22:54 +0200)
- on local networks (LANs) you may not always have valid email addresses, e.g.
  mine here are structured as user@host.local which are not valid and won't
  pass validation check.
- for these rare cases you can bypass the regex check but be warned to NEVER
  do this on a public server!!!

src/Model/User.php
src/Module/Invite.php
static/defaults.config.php

index 5195fb77a3688292ef66b236720ccac3319ead0e..c30935d9d52aefca68bc64a26f527af0be9c7bfc 100644 (file)
@@ -1276,7 +1276,7 @@ class User
                        throw new Exception(DI::l10n()->t('Your email domain is not among those allowed on this site.'));
                }
 
-               if (!filter_var($email, FILTER_VALIDATE_EMAIL) || !Network::isEmailDomainValid($email)) {
+               if (DI::config()->get('system', 'only_valid_email_addresses', true) && (!filter_var($email, FILTER_VALIDATE_EMAIL) || !Network::isEmailDomainValid($email))) {
                        throw new Exception(DI::l10n()->t('Not a valid email address.'));
                }
                if (self::isNicknameBlocked($nickname)) {
index bb8f94c9a5a70b520754479e1ae074cb88956dd6..68144590afe43025cb079002b95759e94d25221a 100644 (file)
@@ -63,7 +63,7 @@ class Invite extends BaseModule
                foreach ($recipients as $recipient) {
                        $recipient = trim($recipient);
 
-                       if (!filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
+                       if (DI::config()->get('system', 'only_valid_email_addresses', true) && !filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
                                DI::sysmsg()->addNotice(DI::l10n()->t('%s : Not a valid email address.', $recipient));
                                continue;
                        }
index 1d1a4a51baab8967ec902daa015b16e35097b030..b14d8088ba344b14cd98f918690d0838566b347a 100644 (file)
@@ -654,6 +654,13 @@ return [
                // xrd_timeout (Integer)
                // Timeout in seconds for fetching the XRD links and other requests with an expected shorter timeout
                'xrd_timeout' => 20,
+
+               // only_valid_email_addresses (Boolean)
+               // WARNING: You normally want to only accept valid email addreses. Under
+               // rare conditions this however can be a hinderence, e.g. on your LAN
+               // where you might have email addresses like user@domain.local which are
+               // surely not valid but still you need to signup to your testing instance
+               'only_valid_email_addresses' => true,
        ],
        'performance' => [
                // max_response_data_size (Integer)