1
1
Fork 0

Merge pull request #10452 from annando/notice

Avoid Notice: Undefined index: field1 in /src/Module/Register.php on line 253
This commit is contained in:
Hypolite Petovan 2021-06-30 21:23:12 -04:00 committed by GitHub
commit 7a2038fc93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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