Using "args"

This commit is contained in:
Michael 2019-10-28 20:38:53 +00:00
parent dd7070938b
commit 8470fa70d3

View file

@ -388,7 +388,7 @@ class Login extends BaseModule
return 'register'; return 'register';
} }
$args = ''; $args = [];
$attr = Session::get('openid_attributes') ?? []; $attr = Session::get('openid_attributes') ?? [];
if (is_array($attr) && count($attr)) { if (is_array($attr) && count($attr)) {
@ -400,10 +400,10 @@ class Login extends BaseModule
$first = Strings::escapeTags(trim($v)); $first = Strings::escapeTags(trim($v));
} }
if ($k === 'namePerson') { if ($k === 'namePerson') {
$args .= '&username=' . urlencode(Strings::escapeTags(trim($v))); $args['username'] = Strings::escapeTags(trim($v));
} }
if ($k === 'contact/email') { if ($k === 'contact/email') {
$args .= '&email=' . urlencode(Strings::escapeTags(trim($v))); $args['email'] = Strings::escapeTags(trim($v));
} }
if ($k === 'media/image/aspect11') { if ($k === 'media/image/aspect11') {
$photosq = bin2hex(trim($v)); $photosq = bin2hex(trim($v));
@ -414,22 +414,20 @@ class Login extends BaseModule
} }
} }
$arg = [];
if (!empty($nick)) { if (!empty($nick)) {
$arg['nickname'] = $nick; $args['nickname'] = $nick;
} elseif (!empty($first)) { } elseif (!empty($first)) {
$arg['nickname'] = $first; $args['nickname'] = $first;
} }
if (!empty($photosq)) { if (!empty($photosq)) {
$arg['photo'] = $photosq; $args['photo'] = $photosq;
} elseif (!empty($photo)) { } elseif (!empty($photo)) {
$arg['photo'] = $photo; $args['photo'] = $photo;
} }
$arg['openid_url'] = Strings::escapeTags(trim(Session::get('openid_identity'))); $args['openid_url'] = Strings::escapeTags(trim(Session::get('openid_identity')));
return 'register?' . http_build_query($arg); return 'register?' . http_build_query($args);
} }
} }