Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
1cb1b132
Unverified
Commit
1cb1b132
authored
5 years ago
by
Roeland Jago Douma
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #17252 from nextcloud/bugfix/noid/user-0-can-not-comment
Fix user with id 0 to be able to comment
parents
6ac67011
e4b36f4f
Loading
Loading
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/Comments/Comment.php
+3
-3
3 additions, 3 deletions
lib/private/Comments/Comment.php
lib/private/Comments/Manager.php
+2
-2
2 additions, 2 deletions
lib/private/Comments/Manager.php
with
5 additions
and
5 deletions
lib/private/Comments/Comment.php
+
3
−
3
View file @
1cb1b132
...
...
@@ -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.'
);
}
...
...
This diff is collapsed.
Click to expand it.
lib/private/Comments/Manager.php
+
2
−
2
View file @
1cb1b132
...
...
@@ -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'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment