aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Comments/Comment.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Comments/Comment.php')
-rw-r--r--lib/private/Comments/Comment.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php
index c9862c64ca6..ef7538d140d 100644
--- a/lib/private/Comments/Comment.php
+++ b/lib/private/Comments/Comment.php
@@ -22,6 +22,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
+
namespace OC\Comments;
use OCP\Comments\IComment;
@@ -299,12 +300,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 +386,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.');
}