Skip to content
Snippets Groups Projects
Commit b4797f4f authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

fixes #3232

Closes #3232

Merge request studip/studip!2193
parent e242c2d0
No related branches found
No related tags found
No related merge requests found
......@@ -54,9 +54,14 @@ class CommentsCreate extends JsonApiController
protected function validateResourceDocument($json, $id = null)
{
if (empty(self::arrayGet($json, 'data.attributes.content'))) {
if (!self::arrayHas($json, 'data.attributes.content')) {
return 'No comment provided';
}
if (mb_strlen(trim(self::arrayGet($json, 'data.attributes.content'))) === 0) {
return 'Comment should not be empty.';
}
if (!$id && !$this->getThreadFromJson($json)) {
return 'Invalid `block` relationship.';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment