summaryrefslogtreecommitdiff
path: root/plugins/OStatus/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-03-18 20:57:38 -0500
committerEvan Prodromou <evan@status.net>2010-03-18 20:57:38 -0500
commitac609e804078cf70fcc02b36aa1eb40115354715 (patch)
treec206723a0fe28fd62f8d2838f589a42ec7523af5 /plugins/OStatus/lib
parent17c50f338ceb574780476f6b788f48e2d7d06017 (diff)
parent4a6c9e445149e42a4f81d5140296e7770c60bc6c (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Conflicts: plugins/OStatus/extlib/hkit/hkit.class.php plugins/OStatus/lib/discoveryhints.php
Diffstat (limited to 'plugins/OStatus/lib')
-rw-r--r--plugins/OStatus/lib/linkheader.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/plugins/OStatus/lib/linkheader.php b/plugins/OStatus/lib/linkheader.php
index 2f6c66dc9..afcd66d26 100644
--- a/plugins/OStatus/lib/linkheader.php
+++ b/plugins/OStatus/lib/linkheader.php
@@ -43,21 +43,21 @@ class LinkHeader
static function getLink($response, $rel=null, $type=null)
{
$headers = $response->getHeader('Link');
+ if ($headers) {
+ // Can get an array or string, so try to simplify the path
+ if (!is_array($headers)) {
+ $headers = array($headers);
+ }
- // Can get an array or string, so try to simplify the path
- if (!is_array($headers)) {
- $headers = array($headers);
- }
-
- foreach ($headers as $header) {
- $lh = new LinkHeader($header);
+ foreach ($headers as $header) {
+ $lh = new LinkHeader($header);
- if ((is_null($rel) || $lh->rel == $rel) &&
- (is_null($type) || $lh->type == $type)) {
- return $lh->href;
+ if ((is_null($rel) || $lh->rel == $rel) &&
+ (is_null($type) || $lh->type == $type)) {
+ return $lh->href;
+ }
}
}
-
return null;
}
-} \ No newline at end of file
+}