]> git.mxchange.org Git - friendica.git/commitdiff
Using "args"
authorMichael <heluecht@pirati.ca>
Mon, 28 Oct 2019 20:38:53 +0000 (20:38 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 28 Oct 2019 20:38:53 +0000 (20:38 +0000)
src/Module/Login.php

index 3999980ec96fe9e22e19f2cdfcd0955f43262156..5284131d7a4a1ce58ec370b9a36c7fef0e36f976 100644 (file)
@@ -388,7 +388,7 @@ class Login extends BaseModule
                        return 'register';
                }
 
-               $args = '';
+               $args = [];
                $attr = Session::get('openid_attributes') ?? [];
 
                if (is_array($attr) && count($attr)) {
@@ -400,10 +400,10 @@ class Login extends BaseModule
                                        $first = Strings::escapeTags(trim($v));
                                }
                                if ($k === 'namePerson') {
-                                       $args .= '&username=' . urlencode(Strings::escapeTags(trim($v)));
+                                       $args['username'] = Strings::escapeTags(trim($v));
                                }
                                if ($k === 'contact/email') {
-                                       $args .= '&email=' . urlencode(Strings::escapeTags(trim($v)));
+                                       $args['email'] = Strings::escapeTags(trim($v));
                                }
                                if ($k === 'media/image/aspect11') {
                                        $photosq = bin2hex(trim($v));
@@ -414,22 +414,20 @@ class Login extends BaseModule
                        }
                }
 
-               $arg = [];
-
                if (!empty($nick)) {
-                       $arg['nickname'] = $nick;
+                       $args['nickname'] = $nick;
                } elseif (!empty($first)) {
-                       $arg['nickname'] = $first;
+                       $args['nickname'] = $first;
                }
 
                if (!empty($photosq)) {
-                       $arg['photo'] = $photosq;
+                       $args['photo'] = $photosq;
                } 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);
        }
 }