From: Brion Vibber Date: Fri, 21 May 2010 17:18:13 +0000 (-0700) Subject: Avoid PHP notice about undefined array index when no avatar photo available from... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cbf2e7cfea6c4360f9cc9037b242f2508964ccac;p=quix0rs-gnu-social.git Avoid PHP notice about undefined array index when no avatar photo available from Google profile --- diff --git a/plugins/OStatus/lib/discoveryhints.php b/plugins/OStatus/lib/discoveryhints.php index ca54a0f5f5..34c9be2777 100644 --- a/plugins/OStatus/lib/discoveryhints.php +++ b/plugins/OStatus/lib/discoveryhints.php @@ -84,7 +84,7 @@ class DiscoveryHints { $hints['fullname'] = implode(' ', $hcard['n']); } - if (array_key_exists('photo', $hcard)) { + if (array_key_exists('photo', $hcard) && count($hcard['photo'])) { $hints['avatar'] = $hcard['photo'][0]; }