From 8c00e88f79c3b78d78b411328f4724ee5d82b587 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 13 Sep 2018 21:11:52 +0000 Subject: [PATCH] The endless saga of the fight against notices continues --- mod/fetch.php | 2 +- src/Protocol/Diaspora.php | 2 +- src/Util/ParseUrl.php | 16 +++++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/mod/fetch.php b/mod/fetch.php index 35455e2822..4e7d8c751a 100644 --- a/mod/fetch.php +++ b/mod/fetch.php @@ -25,7 +25,7 @@ function fetch_init(App $a) // Fetch the item $fields = ['uid', 'title', 'body', 'guid', 'contact-id', 'private', 'created', 'app', 'location', 'coord', 'network', - 'event-id', 'resource-id', 'author-link', 'owner-link', 'attach']; + 'event-id', 'resource-id', 'author-link', 'author-avatar', 'author-name', 'plink', 'owner-link', 'attach']; $condition = ['wall' => true, 'private' => false, 'guid' => $guid, 'network' => [Protocol::DFRN, Protocol::DIASPORA]]; $item = Item::selectFirst($fields, $condition); if (!DBA::isResult($item)) { diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 7af8dbd424..27cfdccd85 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -3496,7 +3496,7 @@ class Diaspora $myaddr = self::myHandle($owner); - $public = (($item["private"]) ? "false" : "true"); + $public = ($item["private"] ? "false" : "true"); $created = DateTimeFormat::utc($item["created"], DateTimeFormat::ATOM); diff --git a/src/Util/ParseUrl.php b/src/Util/ParseUrl.php index 40cb0b8fc0..ac13e15174 100644 --- a/src/Util/ParseUrl.php +++ b/src/Util/ParseUrl.php @@ -486,21 +486,23 @@ class ParseUrl $complete = $schemearr["scheme"]."://".$schemearr["host"]; - if (@$schemearr["port"] != "") { + if (!empty($schemearr["port"])) { $complete .= ":".$schemearr["port"]; } - if (strpos($urlarr["path"], "/") !== 0) { - $complete .= "/"; + if (!empty($urlarr["path"])) { + if (strpos($urlarr["path"], "/") !== 0) { + $complete .= "/"; + } + + $complete .= $urlarr["path"]; } - $complete .= $urlarr["path"]; - - if (@$urlarr["query"] != "") { + if (!empty($urlarr["query"])) { $complete .= "?".$urlarr["query"]; } - if (@$urlarr["fragment"] != "") { + if (!empty($urlarr["fragment"])) { $complete .= "#".$urlarr["fragment"]; }