]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
Merge pull request #4171 from MrPetovan/task/fix-scrutinizer-issues
[friendica.git] / src / Model / Contact.php
index 2203b62162372e482e084e5eb0607a4a41b8720f..067a2fda7f104e44680937d287696b04d1c2100a 100644 (file)
@@ -20,6 +20,7 @@ use Friendica\Protocol\Salmon;
 use dba;
 
 require_once 'boot.php';
+require_once 'include/dba.php';
 require_once 'include/text.php';
 
 /**
@@ -196,7 +197,7 @@ class Contact extends BaseObject
         * up or some other transient event and that there's a possibility we could recover from it.
         *
         * @param array $contact contact to mark for archival
-        * @return type
+        * @return null
         */
        public static function markForArchival(array $contact)
        {
@@ -661,7 +662,7 @@ class Contact extends BaseObject
                if (!DBM::is_result($contact)) {
                        // The link could be provided as http although we stored it as https
                        $ssl_url = str_replace('http://', 'https://', $url);
-                       $r = dba::select('contact', array('id', 'avatar-date'), array('`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid), array('limit' => 1));
+                       $r = dba::select('contact', array('id', 'avatar', 'avatar-date'), array('`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid), array('limit' => 1));
                        $contact = dba::fetch($r);
                        dba::close($r);
                }
@@ -673,7 +674,7 @@ class Contact extends BaseObject
                        $update_contact = ($contact['avatar-date'] < datetime_convert('', '', 'now -7 days'));
 
                        // We force the update if the avatar is empty
-                       if ($contact['avatar'] == '') {
+                       if (!x($contact, 'avatar')) {
                                $update_contact = true;
                        }