diff options
author | tailor <dag@janrain.com> | 2008-06-05 18:45:28 +0000 |
---|---|---|
committer | tailor <dag@janrain.com> | 2008-06-05 18:45:28 +0000 |
commit | ffae436ba5a516ee037b09e105ce5cbdd2c55e08 (patch) | |
tree | b7674ef1c563c223f55e3ee71675e5138b5d6b17 /Auth | |
parent | 89068d2d799fd86980609f502c59a601bfad3c79 (diff) | |
download | php-openid-ffae436ba5a516ee037b09e105ce5cbdd2c55e08.zip php-openid-ffae436ba5a516ee037b09e105ce5cbdd2c55e08.tar.gz php-openid-ffae436ba5a516ee037b09e105ce5cbdd2c55e08.tar.bz2 |
[project @ handle empty string for trustroot the same as missing]
Diffstat (limited to 'Auth')
-rw-r--r-- | Auth/OpenID/Server.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Auth/OpenID/Server.php b/Auth/OpenID/Server.php index 1f53044..d85c9f7 100644 --- a/Auth/OpenID/Server.php +++ b/Auth/OpenID/Server.php @@ -858,19 +858,21 @@ class Auth_OpenID_CheckIDRequest extends Auth_OpenID_Request { // here. But if TrustRoot isn't currently part of the // "public" API, I'm not sure it's worth doing. if ($namespace == Auth_OpenID_OPENID1_NS) { - $trust_root = $message->getArg(Auth_OpenID_OPENID_NS, - 'trust_root', - $return_to); + $trust_root_param = 'trust_root'; } else { - $trust_root = $message->getArg(Auth_OpenID_OPENID_NS, - 'realm', - $return_to); + $trust_root_param = 'realm'; + } + $trust_root = $message->getArg(Auth_OpenID_OPENID_NS, + $trust_root_param); + if (! $trust_root) { + $trust_root = $return_to; + } - if (($return_to === null) && - ($trust_root === null)) { - return new Auth_OpenID_ServerError($message, - "openid.realm required when openid.return_to absent"); - } + if ($namespace != Auth_OpenID_OPENID1_NS && + ($return_to === null) && + ($trust_root === null)) { + return new Auth_OpenID_ServerError($message, + "openid.realm required when openid.return_to absent"); } $assoc_handle = $message->getArg(Auth_OpenID_OPENID_NS, |