]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Avoid notices for accessing undefined array indices in hcard processing
authorBrion Vibber <brion@pobox.com>
Fri, 19 Mar 2010 22:54:16 +0000 (15:54 -0700)
committerBrion Vibber <brion@pobox.com>
Fri, 19 Mar 2010 22:54:54 +0000 (15:54 -0700)
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;
         }