From 518d461a8ffee656983533f04da1ca89a6936b2a Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 2 Oct 2018 20:12:38 +0000 Subject: [PATCH] Issue 5811: "objects" instead of "object" --- mod/display.php | 2 +- src/Model/Item.php | 2 +- src/Module/{Object.php => Objects.php} | 2 +- src/Protocol/ActivityPub.php | 2 +- src/Protocol/Diaspora.php | 2 +- src/Protocol/OStatus.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename src/Module/{Object.php => Objects.php} (92%) diff --git a/mod/display.php b/mod/display.php index 25bda99d01..fe8e960f9e 100644 --- a/mod/display.php +++ b/mod/display.php @@ -78,7 +78,7 @@ function display_init(App $a) } if (ActivityPub::isRequest()) { - goaway(str_replace('display/', 'object/', $a->query_string)); + goaway(str_replace('display/', 'objects/', $a->query_string)); } if ($item["id"] != $item["parent"]) { diff --git a/src/Model/Item.php b/src/Model/Item.php index 2c9be633a9..19ab371d7c 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2361,7 +2361,7 @@ class Item extends BaseObject $guid = System::createUUID(); } - return self::getApp()->get_baseurl() . '/object/' . $guid; + return self::getApp()->get_baseurl() . '/objects/' . $guid; } /** diff --git a/src/Module/Object.php b/src/Module/Objects.php similarity index 92% rename from src/Module/Object.php rename to src/Module/Objects.php index 05aae84f86..8f9c3309b6 100644 --- a/src/Module/Object.php +++ b/src/Module/Objects.php @@ -24,7 +24,7 @@ class Object extends BaseModule } if (!ActivityPub::isRequest()) { - goaway(str_replace('object/', 'display/', $a->query_string)); + goaway(str_replace('objects/', 'display/', $a->query_string)); } $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'wall' => true, 'private' => false]); diff --git a/src/Protocol/ActivityPub.php b/src/Protocol/ActivityPub.php index b5cd102a51..ef4a48479e 100644 --- a/src/Protocol/ActivityPub.php +++ b/src/Protocol/ActivityPub.php @@ -663,7 +663,7 @@ class ActivityPub } elseif (DBA::isResult($conversation) && !empty($conversation['conversation-uri'])) { $context_uri = $conversation['conversation-uri']; } else { - $context_uri = str_replace('/object/', '/context/', $item['parent-uri']); + $context_uri = str_replace('/objects/', '/context/', $item['parent-uri']); } return $context_uri; } diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 847809a36b..551971e504 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -1598,7 +1598,7 @@ class Diaspora unset($parts['path']); $host_url = Network::unparseURL($parts); - return $host_url . '/object/' . $guid; + return $host_url . '/objects/' . $guid; } return ""; diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 2eb8c55390..d56bacc675 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -2004,7 +2004,7 @@ class OStatus } if (intval($item["parent"]) > 0) { - $conversation_href = $conversation_uri = str_replace('/object/', '/context/', $item['parent-uri']); + $conversation_href = $conversation_uri = str_replace('/objects/', '/context/', $item['parent-uri']); if (isset($parent_item)) { $conversation = DBA::selectFirst('conversation', ['conversation-uri', 'conversation-href'], ['item-uri' => $parent_item]); -- 2.39.5