summaryrefslogtreecommitdiffstats
path: root/lib/Model
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-01-18 15:55:10 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-01-19 11:14:38 -0100
commit524c7aa14174c3d6c063b56fe79eeffa03de688d (patch)
tree9040ce9e8414ab1305845f5f4d5b4ab0f0fd1035 /lib/Model
parent898993a67d7c17da3f19be34a6d9824e8c6a5489 (diff)
save/update
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model')
-rw-r--r--lib/Model/ActivityPub/Object/Document.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Model/ActivityPub/Object/Document.php b/lib/Model/ActivityPub/Object/Document.php
index 615ad54e..932392c7 100644
--- a/lib/Model/ActivityPub/Object/Document.php
+++ b/lib/Model/ActivityPub/Object/Document.php
@@ -33,6 +33,7 @@ namespace OCA\Social\Model\ActivityPub\Object;
use DateTime;
use JsonSerializable;
+use OCA\Social\Exceptions\InvalidOriginException;
use OCA\Social\Exceptions\UrlCloudException;
use OCA\Social\Model\ActivityPub\ACore;
@@ -218,6 +219,7 @@ class Document extends ACore implements JsonSerializable {
* @param array $data
*
* @throws UrlCloudException
+ * @throws InvalidOriginException
*/
public function import(array $data) {
parent::import($data);
@@ -226,6 +228,8 @@ class Document extends ACore implements JsonSerializable {
if ($this->getId() === '') {
$this->generateUniqueId('/documents/g');
+ } else {
+ $this->checkOrigin($this->getId());
}
}