]> git.mxchange.org Git - friendica.git/commitdiff
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 9fe3cb4bd7bbf525c97d467572b4e461287aca7d..293a8750dd22e0a60196c4910b2f872539524e9c 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 6cee4d2b806f296a7870c06ef69b52b0709ba8e2..e029f1905cfdd9a37991a00bdff5433f26736a55 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 1c0a1bbd769e2415a739aa2aafe9e542a6282639..ecea3400e271c3e1e8b4af722ebfe4c0f0567a77 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 b18159d40cf0cf823bba43b082e6d897af214b9c..ddca508561ccda383ef80b3090d1a1621906d226 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 366853c999d92da33b20729a838bb164946e3a1c..76c48c3d2de6c5b50bc6fb471ed3a546b62f72cf 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 55d635d2e0b0460f5b4b843f1419a6ce72ed1c55..2802e20301f627ed8c4fc24988be78892af9d8df 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);