Avoid notices for accessing undefined array indices in hcard processing

This commit is contained in:
Brion Vibber 2010-03-19 15:54:16 -07:00
parent c84c4c6839
commit db0cf50f65

View File

@ -102,7 +102,7 @@ class DiscoveryHints {
if (array_key_exists('url', $hcard)) {
if (is_string($hcard['url'])) {
$hints['homepage'] = $hcard['url'];
} else if (is_array($hcard['url'])) {
} else if (is_array($hcard['url']) && !empty($hcard['url'])) {
// HACK get the last one; that's how our hcards look
$hints['homepage'] = $hcard['url'][count($hcard['url'])-1];
}
@ -231,7 +231,7 @@ class DiscoveryHints {
// If it's got a scheme, use it
if ($parts['scheme'] != '') {
if (!empty($parts['scheme'])) {
return $rel;
}