Skip to content

Commit d699e63

Browse files
author
tailor
committed
[project @ Do not send openid.ns values in OpenID 1 messages]
1 parent a3d2f20 commit d699e63

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Auth/OpenID/Message.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ function toPostArgs()
589589
// Add namespace definitions to the output
590590
foreach ($this->namespaces->iteritems() as $pair) {
591591
list($ns_uri, $alias) = $pair;
592+
592593
if ($alias == Auth_OpenID_NULL_NAMESPACE) {
593594
if ($ns_uri != Auth_OpenID_OPENID1_NS) {
594595
$args['openid.ns'] = $ns_uri;
@@ -602,8 +603,10 @@ function toPostArgs()
602603
// could look in the signed list.
603604
}
604605
} else {
605-
$ns_key = 'openid.ns.' . $alias;
606-
$args[$ns_key] = $ns_uri;
606+
if ($this->getOpenIDNamespace() != Auth_OpenID_OPENID1_NS) {
607+
$ns_key = 'openid.ns.' . $alias;
608+
$args[$ns_key] = $ns_uri;
609+
}
607610
}
608611
}
609612

Tests/Auth/OpenID/AuthRequest.php

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ function test_addExtensionArg()
114114
// namespaces. Really it doesn't care that it has alias "0",
115115
// but that is tested anyway
116116
$post_args = $msg->toPostArgs();
117-
$this->assertEquals('bag:', $post_args['openid.ns.ext0']);
118117
$this->assertEquals('brown', $post_args['openid.ext0.color']);
119118
$this->assertEquals('paper', $post_args['openid.ext0.material']);
120119
}

0 commit comments

Comments
 (0)