diff options
author | Zach Copley <zach@status.net> | 2010-03-18 17:11:06 -0700 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-03-18 17:11:06 -0700 |
commit | a6c9445f0de1a74ffc81dda12eaba6ee36410716 (patch) | |
tree | 873d6a67626ef324c0102153c6a027291767b878 /plugins/OStatus/lib/linkheader.php | |
parent | 051bee988caa4a8d3648fae9f963cb35d26c13c5 (diff) | |
parent | 1301877dfe89c57c182246c0d7ba0ff6335fd17b (diff) |
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline:
OStatus discover fixes:
Remove xpm support (no one really uses it, and IMAGETYPE_XPM is undefined, causing warnings)
Fix notice warning about unused var -- was renamed during refactoring.
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 +} |