diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php index c9862c64ca6b25c1b272ed82b63bbc21509313f6..7c935930f284f308a2ff8c5c67dd78901ed7d3f3 100644 --- a/lib/private/Comments/Comment.php +++ b/lib/private/Comments/Comment.php @@ -299,12 +299,12 @@ class Comment implements IComment { public function setActor($actorType, $actorId) { if( !is_string($actorType) || !trim($actorType) - || !is_string($actorId) || !trim($actorId) + || !is_string($actorId) || $actorId === '' ) { throw new \InvalidArgumentException('String expected.'); } $this->data['actorType'] = trim($actorType); - $this->data['actorId'] = trim($actorId); + $this->data['actorId'] = $actorId; return $this; } @@ -385,7 +385,7 @@ class Comment implements IComment { public function setObject($objectType, $objectId) { if( !is_string($objectType) || !trim($objectType) - || !is_string($objectId) || !trim($objectId) + || !is_string($objectId) || trim($objectId) === '' ) { throw new \InvalidArgumentException('String expected.'); } diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index e54218509dcc1bef52926f27c08f658dbecc4fac..024dd58b89ca4ccff6422b3a75090f83295d664d 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -118,9 +118,9 @@ class Manager implements ICommentsManager { */ protected function prepareCommentForDatabaseWrite(IComment $comment) { if (!$comment->getActorType() - || !$comment->getActorId() + || $comment->getActorId() === '' || !$comment->getObjectType() - || !$comment->getObjectId() + || $comment->getObjectId() === '' || !$comment->getVerb() ) { throw new \UnexpectedValueException('Actor, Object and Verb information must be provided for saving');