]> git.mxchange.org Git - friendica.git/commitdiff
Avoid Notice: Undefined index: field1 in /src/Module/Register.php on line 253
authorMichael <heluecht@pirati.ca>
Wed, 30 Jun 2021 19:13:27 +0000 (19:13 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 30 Jun 2021 19:13:27 +0000 (19:13 +0000)
src/Module/Register.php

index 35be8ce2908c558d437bacaebafc22634ca36d7b..6e36023f3837bd35ca5375cfbfe708f83fc2d784 100644 (file)
@@ -248,10 +248,6 @@ class Register extends BaseModule
                        DI::baseUrl()->redirect('register/');
                }
 
-
-               // Overwriting the "tar pit" field with the real one
-               $arr['email'] = $arr['field1'];
-
                if ($additional_account) {
                        $user = DBA::selectFirst('user', ['email'], ['uid' => local_user()]);
                        if (!DBA::isResult($user)) {
@@ -264,6 +260,9 @@ class Register extends BaseModule
 
                        $arr['password1'] = $arr['confirm'] = $arr['parent_password'];
                        $arr['repeat'] = $arr['email'] = $user['email'];
+               } else {
+                       // Overwriting the "tar pit" field with the real one
+                       $arr['email'] = $arr['field1'];
                }
 
                if ($arr['email'] != $arr['repeat']) {