Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions openid.php
Original file line number Diff line number Diff line change
Expand Up @@ -979,17 +979,19 @@ protected function getSregAttributes()
{
$attributes = array();
$sreg_to_ax = array_flip(self::$ax_to_sreg);
foreach (explode(',', $this->data['openid_signed']) as $key) {
$keyMatch = 'sreg.';
if (strncmp($key, $keyMatch, strlen($keyMatch)) !== 0) {
continue;
}
$key = substr($key, strlen($keyMatch));
if (!isset($sreg_to_ax[$key])) {
# The field name isn't part of the SREG spec, so we ignore it.
continue;
if ($alias = $this->getNamespaceAlias('http://openid.net/extensions/sreg/1.1', 'sreg')) {
foreach (explode(',', $this->data['openid_signed']) as $key) {
$keyMatch = $alias . '.';
if (strncmp($key, $keyMatch, strlen($keyMatch)) !== 0) {
continue;
}
$key = substr($key, strlen($keyMatch));
if (!isset($sreg_to_ax[$key])) {
# The field name isn't part of the SREG spec, so we ignore it.
continue;
}
$attributes[$sreg_to_ax[$key]] = $this->data['openid_' . $alias . '_' . $key];
}
$attributes[$sreg_to_ax[$key]] = $this->data['openid_sreg_' . $key];
}
return $attributes;
}
Expand Down