forked from GNUsocial/gnu-social
Avoid notices for accessing undefined array indices in hcard processing
This commit is contained in:
parent
7e2af3dcae
commit
a02e5b302b
@ -102,7 +102,7 @@ class DiscoveryHints {
|
|||||||
if (array_key_exists('url', $hcard)) {
|
if (array_key_exists('url', $hcard)) {
|
||||||
if (is_string($hcard['url'])) {
|
if (is_string($hcard['url'])) {
|
||||||
$hints['homepage'] = $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
|
// HACK get the last one; that's how our hcards look
|
||||||
$hints['homepage'] = $hcard['url'][count($hcard['url'])-1];
|
$hints['homepage'] = $hcard['url'][count($hcard['url'])-1];
|
||||||
}
|
}
|
||||||
@ -231,7 +231,7 @@ class DiscoveryHints {
|
|||||||
|
|
||||||
// If it's got a scheme, use it
|
// If it's got a scheme, use it
|
||||||
|
|
||||||
if ($parts['scheme'] != '') {
|
if (!empty($parts['scheme'])) {
|
||||||
return $rel;
|
return $rel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user