Skip to content

Commit a6b4f08

Browse files
author
Lilli
committed
Added the following patch from the [email protected] mailing list:
http://lists.openidenabled.com/pipermail/dev/attachments/20090206/f0d91666/attachment-0001.bin Original Message: will at willnorris.com will at willnorris.com Fri Feb 6 14:56:12 PST 2009 darcs patch: Properly handle Yadis discovery failure "The library does not curently handle failures during Yadis discovery properly. Specifically, if Yadis discovery fails, and discovery WAS being done with an XRDS document, then non-Yadis discovery should be attempted. The use-case I'm dealing with right now that exposes this bug is when an XRDS document location is advertised (via HTTP response header or <meta /> HTML tag), but the document is not able to be retrieved for whatever reason. The library is failing in this case, instead of continuing to attempt non-Yadis discovery. This patch includes two changes: - change to Yadis/Yadis.php that properly detects if XRDS was used - change to OpenID/Discovery.php that prevents discovery from halting in the above example" This patch was in the form of a Darcs patch, not a normal patch. So solve this, I applied it to the Darcs repository found on openidenabled, then created a new diff file between the original Darcs repo and the new one (with the patch applied) so that I could apply it to this git repo. All hunks were applied successfully.
1 parent 8f98800 commit a6b4f08

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Auth/OpenID/Discover.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ function Auth_OpenID_discoverWithYadis($uri, &$fetcher,
496496
$yadis_url = $response->normalized_uri;
497497
$yadis_services = array();
498498

499-
if ($response->isFailure()) {
499+
if ($response->isFailure() && !$response->isXRDS()) {
500500
return array($uri, array());
501501
}
502502

Auth/Yadis/Yadis.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function services()
105105
function usedYadisLocation()
106106
{
107107
// Was the Yadis protocol's indirection used?
108-
return $this->normalized_uri != $this->xrds_uri;
108+
return ($this->xrds_uri && $this->normalized_uri != $this->xrds_uri);
109109
}
110110

111111
function isXRDS()

0 commit comments

Comments
 (0)