Skip to content
Snippets Groups Projects
Verified Commit 868487d2 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #11292 TIME 0:05 control parent_id and folder id in update folder

parent feddfcc4
No related branches found
No related tags found
No related merge requests found
...@@ -187,6 +187,9 @@ class FolderController ...@@ -187,6 +187,9 @@ class FolderController
if (!empty($data['parent_id']) &&!Validator::intval()->validate($data['parent_id'])) { if (!empty($data['parent_id']) &&!Validator::intval()->validate($data['parent_id'])) {
return $response->withStatus(400)->withJson(['errors' => 'Body parent_id is not a numeric']); return $response->withStatus(400)->withJson(['errors' => 'Body parent_id is not a numeric']);
} }
if ($data['parent_id'] == $aArgs['id']) {
return $response->withStatus(400)->withJson(['errors' => 'Parent_id and id can not be the same']);
}
$folder = FolderController::getScopeFolders(['login' => $GLOBALS['userId'], 'folderId' => $aArgs['id'], 'edition' => true]); $folder = FolderController::getScopeFolders(['login' => $GLOBALS['userId'], 'folderId' => $aArgs['id'], 'edition' => true]);
if (empty($folder[0])) { if (empty($folder[0])) {
......
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