Removed notices, will it ever end?
authorMichael <heluecht@pirati.ca>
Fri, 17 Aug 2018 03:19:42 +0000 (03:19 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 17 Aug 2018 03:19:42 +0000 (03:19 +0000)
include/api.php
mod/network.php
mod/smilies.php
src/Model/Contact.php
src/Network/Probe.php
src/Protocol/DFRN.php

index 9fe3cb4..293a875 100644 (file)
@@ -5812,7 +5812,7 @@ function api_friendica_profile_show($type)
                $nurls = q(
                        "SELECT `id`, `nurl` FROM `contact` WHERE `uid`= %d AND `profile-id` = %d",
                        intval(api_user()),
-                       intval($rr['profile_id'])
+                       intval($rr['id'])
                );
 
                foreach ($nurls as $nurl) {
index 6cee4d2..e029f19 100644 (file)
@@ -449,7 +449,7 @@ function networkFlatView(App $a, $update = 0)
                while ($term = DBA::fetch($result)) {
                        $posts[] = $term['oid'];
                }
-               DBA::close($terms);
+               DBA::close($result);
 
                $condition = ['uid' => local_user(), 'id' => $posts];
        } else {
index 1c0a1bb..ecea340 100644 (file)
@@ -13,7 +13,7 @@ use Friendica\Core\System;
 function smilies_content(App $a)
 {
        $smilies = Smilies::getList();
-       if ($a->argv[1] === "json") {
+       if (!empty($a->argv[1]) && ($a->argv[1] === "json")) {
                $results = [];
                for ($i = 0; $i < count($smilies['texts']); $i++) {
                        $results[] = ['text' => $smilies['texts'][$i], 'icon' => $smilies['icons'][$i]];
index b18159d..ddca508 100644 (file)
@@ -364,6 +364,11 @@ class Contact extends BaseObject
         */
        public static function markForArchival(array $contact)
        {
+
+               if (!isset($contact['url'])) {
+                       logger('Empty contact. ' . System::callstack(10), LOGGER_DEBUG);
+               }
+
                // Contact already archived or "self" contact? => nothing to do
                if ($contact['archive'] || $contact['self']) {
                        return;
index 366853c..76c48c3 100644 (file)
@@ -988,7 +988,9 @@ class Probe
 
                if (!empty($webfinger["aliases"]) && is_array($webfinger["aliases"])) {
                        foreach ($webfinger["aliases"] as $alias) {
-                               if (normalise_link($alias) != normalise_link($data["url"]) && ! strstr($alias, "@")) {
+                               if (empty($data["url"]) && !strstr($alias, "@")) {
+                                       $data["url"] = $alias;
+                               } elseif (!strstr($alias, "@") && normalise_link($alias) != normalise_link($data["url"])) {
                                        $data["alias"] = $alias;
                                } elseif (substr($alias, 0, 5) == 'acct:') {
                                        $data["addr"] = substr($alias, 5);
index 55d635d..2802e20 100644 (file)
@@ -1580,6 +1580,16 @@ class DFRN
                        $author["avatar"] = current($avatarlist);
                }
 
+               if (empty($author['avatar']) && !empty($author['link'])) {
+                       $cid = Contact::getIdForURL($author['link'], 0);
+                       if (!empty($cid)) {
+                               $contact = DBA::selectFirst('contact', ['avatar'], ['id' => $cid]);
+                               if (DBA::isResult($contact)) {
+                                       $author['avatar'] = $contact['avatar'];
+                               }
+                       }
+               }
+
                if (DBA::isResult($contact_old) && !$onlyfetch) {
                        logger("Check if contact details for contact " . $contact_old["id"] . " (" . $contact_old["nick"] . ") have to be updated.", LOGGER_DEBUG);