]> 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>
Wed, 17 Jan 2024 00:03:00 +0000 (01:03 +0100)
- 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 f90d60c3cdd626eb4d1f525b438cf9426e529cd6..3463437103de113e58a83c639d775fed5dda6c27 100644 (file)
@@ -1240,7 +1240,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 1f750f459fea19973dafae5284bd6fa0a6f05472..f300f96435e76a0949d8609218e78a8c6fd2a7b5 100644 (file)
@@ -78,7 +78,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 8519e117beb085d0a560188dad8c289ce2164633..ef464c56d1924e7569bdf26deb56aa27825df5fa 100644 (file)
@@ -613,6 +613,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,
        ],
        'proxy' => [
                // forwarded_for_headers (String)