From b776706c03463c2d9159ec44d065309d992a8b14 Mon Sep 17 00:00:00 2001 From: Klimov Paul Date: Wed, 1 Jan 2014 21:07:04 +0200 Subject: [PATCH] OpenId::buildAxParams() fixed to add "openid.ax.required" parameter if required attributes are not empty. --- extensions/yii/authclient/OpenId.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/yii/authclient/OpenId.php b/extensions/yii/authclient/OpenId.php index ea04d44..a173699 100644 --- a/extensions/yii/authclient/OpenId.php +++ b/extensions/yii/authclient/OpenId.php @@ -638,8 +638,8 @@ class OpenId extends BaseClient implements ClientInterface $params['openid.ax.mode'] = 'fetch_request'; $aliases = []; $counts = []; - $required = []; - $optional = []; + $requiredAttributes = []; + $optionalAttributes = []; foreach (['requiredAttributes', 'optionalAttributes'] as $type) { foreach ($this->$type as $alias => $field) { if (is_int($alias)) { @@ -665,11 +665,11 @@ class OpenId extends BaseClient implements ClientInterface // Don't send empty ax.requied and ax.if_available. // Google and possibly other providers refuse to support ax when one of these is empty. - if ($required) { - $params['openid.ax.required'] = implode(',', $required); + if (!empty($requiredAttributes)) { + $params['openid.ax.required'] = implode(',', $requiredAttributes); } - if ($optional) { - $params['openid.ax.if_available'] = implode(',', $optional); + if (!empty($optionalAttributes)) { + $params['openid.ax.if_available'] = implode(',', $optionalAttributes); } } return $params;