summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Interfaces/Object/DocumentInterface.php2
-rw-r--r--lib/Service/CurlService.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Interfaces/Object/DocumentInterface.php b/lib/Interfaces/Object/DocumentInterface.php
index 863ac8fe..b0e6efc5 100644
--- a/lib/Interfaces/Object/DocumentInterface.php
+++ b/lib/Interfaces/Object/DocumentInterface.php
@@ -101,7 +101,7 @@ class DocumentInterface implements IActivityPubInterface {
*/
public function save(ACore $item) {
/** @var Document $item */
- if ($item->getParent()) {
+ if (!$item->isRoot()) {
$item->setParentId(
$item->getParent()
->getId()
diff --git a/lib/Service/CurlService.php b/lib/Service/CurlService.php
index 376283e8..514a5a11 100644
--- a/lib/Service/CurlService.php
+++ b/lib/Service/CurlService.php
@@ -103,7 +103,7 @@ class CurlService {
// we consider an account is like an email
if (!filter_var($account, FILTER_VALIDATE_EMAIL)) {
- throw new InvalidResourceException();
+ throw new InvalidResourceException('account format is not valid');
}
list($username, $host) = explode('@', $account);