X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fopenid.php;h=45b80638d5e3723ea306c8ed09cf1df112a85dd6;hb=f22fe7118d52251dbd0898279ef078b797885ec4;hp=60a9c1381b083e5322be743bf4241ac0169887d2;hpb=d4c3dcf2fccefcb2c79881be09fd3b1c73dc611a;p=friendica.git diff --git a/mod/openid.php b/mod/openid.php index 60a9c1381b..45b80638d5 100644 --- a/mod/openid.php +++ b/mod/openid.php @@ -1,14 +1,17 @@ config['register_policy'] == REGISTER_CLOSED) { + if ($a->config['register_policy'] == REGISTER_CLOSED) { notice( t('Account not found and OpenID registration is not permitted on this site.') . EOL); - goaway(z_root()); + goaway(System::baseUrl()); } unset($_SESSION['register']); $args = ''; $attr = $openid->getAttributes(); - if(is_array($attr) && count($attr)) { - foreach($attr as $k => $v) { - if($k === 'namePerson/friendly') + if (is_array($attr) && count($attr)) { + foreach ($attr as $k => $v) { + if ($k === 'namePerson/friendly') { $nick = notags(trim($v)); - if($k === 'namePerson/first') + } + if($k === 'namePerson/first') { $first = notags(trim($v)); - if($k === 'namePerson') - $args .= '&username=' . notags(trim($v)); - if($k === 'contact/email') - $args .= '&email=' . notags(trim($v)); - if($k === 'media/image/aspect11') + } + if($k === 'namePerson') { + $args .= '&username=' . urlencode(notags(trim($v))); + } + if ($k === 'contact/email') { + $args .= '&email=' . urlencode(notags(trim($v))); + } + if ($k === 'media/image/aspect11') { $photosq = bin2hex(trim($v)); - if($k === 'media/image/default') + } + if ($k === 'media/image/default') { $photo = bin2hex(trim($v)); + } } } - if($nick) - $args .= '&nickname=' . $nick; - elseif($first) - $args .= '&nickname=' . $first; + if ($nick) { + $args .= '&nickname=' . urlencode($nick); + } + elseif ($first) { + $args .= '&nickname=' . urlencode($first); + } - if($photosq) - $args .= '&photo=' . $photosq; - elseif($photo) - $args .= '&photo=' . $photo; + if ($photosq) { + $args .= '&photo=' . urlencode($photosq); + } + elseif ($photo) { + $args .= '&photo=' . urlencode($photo); + } - $args .= '&openid_url=' . notags(trim($authid)); + $args .= '&openid_url=' . urlencode(notags(trim($authid))); - goaway($a->get_baseurl() . '/register' . $args); + goaway(System::baseUrl() . '/register?' . $args); // NOTREACHED } } notice( t('Login failed.') . EOL); - goaway(z_root()); + goaway(System::baseUrl()); // NOTREACHED }