From: Brion Vibber Date: Fri, 19 Mar 2010 22:54:16 +0000 (-0700) Subject: Avoid notices for accessing undefined array indices in hcard processing X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a02e5b302b47cf7a28c2322700a8ec72d31ab22c;p=quix0rs-gnu-social.git Avoid notices for accessing undefined array indices in hcard processing --- diff --git a/plugins/OStatus/lib/discoveryhints.php b/plugins/OStatus/lib/discoveryhints.php index 9102788e6f..80cfbbf15e 100644 --- a/plugins/OStatus/lib/discoveryhints.php +++ b/plugins/OStatus/lib/discoveryhints.php @@ -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; }