From f0d290eb1810b2ece97548c7a844a8d68404cb9c Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Tue, 27 Nov 2018 22:54:16 +0100 Subject: [PATCH 001/109] Fix Term exists check on link which isn't stored for hashtags anymore to check on term. --- src/Model/Term.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Term.php b/src/Model/Term.php index 3718887122..0d44acd2c9 100644 --- a/src/Model/Term.php +++ b/src/Model/Term.php @@ -156,7 +156,7 @@ class Term $link = ''; } - if (DBA::exists('term', ['uid' => $message['uid'], 'otype' => TERM_OBJ_POST, 'oid' => $itemid, 'url' => $link])) { + if (DBA::exists('term', ['uid' => $message['uid'], 'otype' => TERM_OBJ_POST, 'oid' => $itemid, 'term' => $term])) { continue; } From 39ce33f7ed616a2283071a2bed4340695905a29e Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 29 Nov 2018 15:06:00 +0000 Subject: [PATCH 002/109] Issue 6212: No need of a redirect for fetching content --- mod/display.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mod/display.php b/mod/display.php index 39661cb76f..1bb2a6ec81 100644 --- a/mod/display.php +++ b/mod/display.php @@ -82,7 +82,16 @@ function display_init(App $a) } if (ActivityPub::isRequest()) { - $a->internalRedirect(str_replace('display/', 'objects/', $a->query_string)); + $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'origin' => true, 'private' => false]); + if (!DBA::isResult($item)) { + System::httpExit(404); + } + + $data = ActivityPub\Transmitter::createObjectFromItemID($item['id']); + + header('Content-Type: application/activity+json'); + echo json_encode($data); + exit(); } if ($item["id"] != $item["parent"]) { From 9d8eca2287b7c256d7c879a81f4e28982b93f117 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 29 Nov 2018 22:42:10 +0000 Subject: [PATCH 003/109] Using the same function for display and objects --- mod/display.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mod/display.php b/mod/display.php index 1bb2a6ec81..fc3ab7db0e 100644 --- a/mod/display.php +++ b/mod/display.php @@ -22,6 +22,7 @@ use Friendica\Model\Profile; use Friendica\Protocol\ActivityPub; use Friendica\Protocol\DFRN; use Friendica\Util\Strings; +use Friendica\Module\Objects; function display_init(App $a) { @@ -82,16 +83,7 @@ function display_init(App $a) } if (ActivityPub::isRequest()) { - $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'origin' => true, 'private' => false]); - if (!DBA::isResult($item)) { - System::httpExit(404); - } - - $data = ActivityPub\Transmitter::createObjectFromItemID($item['id']); - - header('Content-Type: application/activity+json'); - echo json_encode($data); - exit(); + Objects::rawContent(); } if ($item["id"] != $item["parent"]) { From 663ba65f17ea821d5675a26280f955c0056203cf Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 30 Nov 2018 05:43:07 -0500 Subject: [PATCH 004/109] Remove "all" value for nets parameter --- mod/network.php | 11 +++-------- src/Content/Nav.php | 2 +- src/Module/Contact.php | 3 --- view/templates/contact_edit.tpl | 2 +- view/templates/nets.tpl | 2 +- view/theme/frio/templates/contact_edit.tpl | 2 +- view/theme/frio/templates/nets.tpl | 2 +- view/theme/quattro/templates/nets.tpl | 2 +- view/theme/vier/templates/contact_edit.tpl | 2 +- 9 files changed, 10 insertions(+), 18 deletions(-) diff --git a/mod/network.php b/mod/network.php index 594a557997..e4e1dd3c53 100644 --- a/mod/network.php +++ b/mod/network.php @@ -65,7 +65,7 @@ function network_init(App $a) $cid = 0; if (x($_GET, 'cid') && intval($_GET['cid']) != 0) { $cid = $_GET['cid']; - $_GET['nets'] = 'all'; + $_GET['nets'] = ''; $group_id = 0; } @@ -86,7 +86,7 @@ function network_init(App $a) // fetch last used network view and redirect if needed if (!$is_a_date_query) { - $sel_nets = defaults($_GET, 'nets', false); + $sel_nets = defaults($_GET, 'nets', ''); $sel_tabs = network_query_get_sel_tab($a); $sel_groups = network_query_get_sel_group($a); $last_sel_tabs = PConfig::get(local_user(), 'network.view', 'tab.selected'); @@ -137,7 +137,7 @@ function network_init(App $a) } } - if ($sel_nets !== false) { + if ($sel_nets) { $net_args['nets'] = $sel_nets; } @@ -151,11 +151,6 @@ function network_init(App $a) } } - // If nets is set to all, unset it - if (x($_GET, 'nets') && $_GET['nets'] === 'all') { - unset($_GET['nets']); - } - if (!x($a->page, 'aside')) { $a->page['aside'] = ''; } diff --git a/src/Content/Nav.php b/src/Content/Nav.php index b8691e9340..7311f046a1 100644 --- a/src/Content/Nav.php +++ b/src/Content/Nav.php @@ -234,7 +234,7 @@ class Nav // The following nav links are only show to logged in users if (local_user()) { $nav['network'] = ['network', L10n::t('Network'), '', L10n::t('Conversations from your friends')]; - $nav['net_reset'] = ['network/0?f=&order=comment&nets=all', L10n::t('Network Reset'), '', L10n::t('Load Network page with no filters')]; + $nav['net_reset'] = ['network/?f=', L10n::t('Network Reset'), '', L10n::t('Load Network page with no filters')]; $nav['home'] = ['profile/' . $a->user['nickname'], L10n::t('Home'), '', L10n::t('Your posts and conversations')]; diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 66e8c97fdf..12575064b9 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -40,9 +40,6 @@ class Contact extends BaseModule } $nets = defaults($_GET, 'nets', ''); - if ($nets == 'all') { - $nets = ''; - } if (!x($a->page, 'aside')) { $a->page['aside'] = ''; diff --git a/view/templates/contact_edit.tpl b/view/templates/contact_edit.tpl index b4c34f74e2..590af0205d 100644 --- a/view/templates/contact_edit.tpl +++ b/view/templates/contact_edit.tpl @@ -46,7 +46,7 @@ {{* End of contact-edit-status-wrapper *}} diff --git a/view/templates/nets.tpl b/view/templates/nets.tpl index ea28bc665c..c27e8367cc 100644 --- a/view/templates/nets.tpl +++ b/view/templates/nets.tpl @@ -2,7 +2,7 @@

{{$title}}

{{$desc}}
- {{$all}} + {{$all}}
{{* End of contact-edit-status-wrapper *}} diff --git a/view/theme/frio/templates/nets.tpl b/view/theme/frio/templates/nets.tpl index da637e7cf7..4f9bfe22f4 100644 --- a/view/theme/frio/templates/nets.tpl +++ b/view/theme/frio/templates/nets.tpl @@ -3,7 +3,7 @@

{{$title}}

{{$desc}}