diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-18 17:19:28 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-18 17:19:28 -0700 |
commit | 3e2e88b0dfb0f5b3baa336a9b3f69e8e8244c8e6 (patch) | |
tree | 7de5edd8b9c74d5a29f7443b1a52a269f5f9d6e3 /plugins/OStatus/lib/linkheader.php | |
parent | 9c5af9a38f82afee92a78303aaa4604794ef6866 (diff) | |
parent | 01a1e882afeb78542b02e4643c5d8a2fa50c2206 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'plugins/OStatus/lib/linkheader.php')
-rw-r--r-- | plugins/OStatus/lib/linkheader.php | 24 |
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 +} |