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 7e2af3dcae
commit a02e5b302b

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;
}