Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: XRD.php
- ===================================================================
- --- XRD.php (revision 890)
- +++ XRD.php (working copy)
- @@ -48,7 +48,9 @@
- */
- public $service;
- + public $canonicalId;
- +
- /**
- * Constructor.
- *
- @@ -96,6 +98,10 @@
- $service = XRDS_Service::from_dom($node);
- $xrd->service[] = $service;
- break;
- +
- + case 'CanonicalID':
- + $xrd->canonicalId = $node->nodeValue;
- + break;
- }
- }
- Index: Discovery.php
- ===================================================================
- --- Discovery.php (revision 890)
- +++ Discovery.php (working copy)
- @@ -18,6 +18,8 @@
- * 5. (Extension) OpenID 1 Link Location
- * - look for openid.server in HTML <head>
- * - if link exists, build XRDS and finish
- + * 6. (Google Extension) host meta document.
- + * - look for XRDS location in responde header
- *
- *
- * Potential future flow
- @@ -51,6 +53,7 @@
- $this->register_discovery_method('XRDS_Discovery_Content_Negotiation');
- $this->register_discovery_method('XRDS_Discovery_Location_Header');
- $this->register_discovery_method('XRDS_Discovery_HTML_Meta');
- + $this->register_discovery_method('XRDS_Discovery_Host_Meta');
- }
- @@ -248,4 +251,17 @@
- }
- +/**
- + * Google XRDS Discovery Method.
- + */
- +class XRDS_Discovery_Host_Meta extends XRDS_Discovery_Method {
- + public function discover(XRDS_Discovery_Context &$context) {
- + if (preg_match('# rel=("|\')?describedby http://reltype.google.com/openid/xrd-op\\1#i', $context->content)) {
- + preg_match('/ <([^>]*)>/', $context->content, $matches);
- + return XRDS_Discovery::fetch_xrds_url($matches[1]);
- + }
- + }
- +}
- +
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement