]> git.mxchange.org Git - friendica.git/commitdiff
Issue 5811: "objects" instead of "object"
authorMichael <heluecht@pirati.ca>
Tue, 2 Oct 2018 20:12:38 +0000 (20:12 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 2 Oct 2018 20:12:38 +0000 (20:12 +0000)
mod/display.php
src/Model/Item.php
src/Module/Object.php [deleted file]
src/Module/Objects.php [new file with mode: 0644]
src/Protocol/ActivityPub.php
src/Protocol/Diaspora.php
src/Protocol/OStatus.php

index 25bda99d013881eeacd20ecf08a1f4e3ddefa3f4..fe8e960f9eb600aa3b971e258326713a0d8f3a29 100644 (file)
@@ -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"]) {
index 2c9be633a9ae8083e1c2178d140bfac0895ed5a9..19ab371d7c0f9581f86e0709fa45e12f81c5bdfc 100644 (file)
@@ -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/Object.php
deleted file mode 100644 (file)
index 05aae84..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * @file src/Module/Object.php
- */
-namespace Friendica\Module;
-
-use Friendica\BaseModule;
-use Friendica\Protocol\ActivityPub;
-use Friendica\Core\System;
-use Friendica\Model\Item;
-use Friendica\Database\DBA;
-
-/**
- * ActivityPub Object
- */
-class Object extends BaseModule
-{
-       public static function rawContent()
-       {
-               $a = self::getApp();
-
-               if (empty($a->argv[1])) {
-                       System::httpExit(404);
-               }
-
-               if (!ActivityPub::isRequest()) {
-                       goaway(str_replace('object/', 'display/', $a->query_string));
-               }
-
-               $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'wall' => true, 'private' => false]);
-               if (!DBA::isResult($item)) {
-                       System::httpExit(404);
-               }
-
-               $data = ActivityPub::createObjectFromItemID($item['id']);
-
-               header('Content-Type: application/activity+json');
-               echo json_encode($data);
-               exit();
-       }
-}
diff --git a/src/Module/Objects.php b/src/Module/Objects.php
new file mode 100644 (file)
index 0000000..8f9c330
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * @file src/Module/Object.php
+ */
+namespace Friendica\Module;
+
+use Friendica\BaseModule;
+use Friendica\Protocol\ActivityPub;
+use Friendica\Core\System;
+use Friendica\Model\Item;
+use Friendica\Database\DBA;
+
+/**
+ * ActivityPub Object
+ */
+class Object extends BaseModule
+{
+       public static function rawContent()
+       {
+               $a = self::getApp();
+
+               if (empty($a->argv[1])) {
+                       System::httpExit(404);
+               }
+
+               if (!ActivityPub::isRequest()) {
+                       goaway(str_replace('objects/', 'display/', $a->query_string));
+               }
+
+               $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'wall' => true, 'private' => false]);
+               if (!DBA::isResult($item)) {
+                       System::httpExit(404);
+               }
+
+               $data = ActivityPub::createObjectFromItemID($item['id']);
+
+               header('Content-Type: application/activity+json');
+               echo json_encode($data);
+               exit();
+       }
+}
index b5cd102a51d4ac1e74295edd915f3020b2d4d875..ef4a48479ea2a4c677704763af81d10272e443a8 100644 (file)
@@ -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;
        }
index 847809a36b716d96a17314f67a45f5bc3e03eef3..551971e504f2e74b090a3226f5cd5f64e5aa5dc0 100644 (file)
@@ -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 "";
index 2eb8c55390afd2bcb0e26ff30e719227a7c5edbf..d56bacc67512d45fd81561ed189657bc08ed8a53 100644 (file)
@@ -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]);