My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 14 attachment: 0001-allowed-more-types-of-yadis-xml-file.patch (1.5 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From a48f07b4c6598cf77c76a9d2b4a479a9bbf89631 Mon Sep 17 00:00:00 2001
From: Jan Dolecek <juzna.cz@gmail.com>
Date: Tue, 2 Nov 2010 11:29:37 +0000
Subject: [PATCH] allowed more types of yadis xml file

---
openid.php | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/openid.php b/openid.php
index c01f8ae..39bd172 100644
--- a/openid.php
+++ b/openid.php
@@ -275,10 +275,17 @@ class LightOpenID
$url = $this->build_url(parse_url($url), parse_url(trim($headers['x-xrds-location'])));
$next = true;
}
-
- if (isset($headers['content-type'])
- && strpos($headers['content-type'], 'application/xrds+xml') !== false
- ) {
+
+ static $allowedContentTypes = array('application/xrds+xml', 'text/xml');
+
+ if(isset($headers['content-type'])) {
+ $contentType = $headers['content-type'];
+ $pos = strpos($contentType, ';');
+ if($pos !== false) $contentType = substr($contentType, 0, $pos);
+ }
+ else $contentType = null;
+
+ if (isset($contentType) && in_array($contentType, $allowedContentTypes)) {
# Found an XRDS document, now let's find the server, and optionally delegate.
$content = $this->request($url, 'GET');

--
1.7.0.4

Powered by Google Project Hosting