Browse Source

Removed notices, will it ever end?

pull/5626/head
Michael 3 years ago
parent
commit
0342f9e084
  1. 2
      include/api.php
  2. 2
      mod/network.php
  3. 2
      mod/smilies.php
  4. 5
      src/Model/Contact.php
  5. 4
      src/Network/Probe.php
  6. 10
      src/Protocol/DFRN.php

2
include/api.php

@ -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) {

2
mod/network.php

@ -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 {

2
mod/smilies.php

@ -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]];

5
src/Model/Contact.php

@ -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;

4
src/Network/Probe.php

@ -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);

10
src/Protocol/DFRN.php

@ -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);

Loading…
Cancel
Save