]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/lib/discoveryhints.php
Avoid notices for accessing undefined array indices in hcard processing
[quix0rs-gnu-social.git] / plugins / OStatus / lib / discoveryhints.php
index 9102788e6fbe3488a68093fd30505c8e3abf9d97..80cfbbf15e589698e5903fcf1f02763516ed4e01 100644 (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;
         }