diff --git a/package.json b/package.json index 7840bb931348ea7d189f69d99b40fa407c1330dc..c79a2de7b4cdbc4082c08dff39df7cbca50e35ac 100644 --- a/package.json +++ b/package.json @@ -28,32 +28,32 @@ }, "devDependencies": { "@angular-devkit/build-angular": "^0.1100.7", - "@angular/animations": "^11.2.3", - "@angular/cdk": "^11.2.2", - "@angular/cli": "^11.2.2", - "@angular/common": "^11.2.3", - "@angular/compiler": "^11.2.3", - "@angular/compiler-cli": "^11.2.3", - "@angular/core": "^11.2.3", - "@angular/forms": "^11.2.3", - "@angular/language-service": "^11.2.3", - "@angular/material": "^11.2.2", - "@angular/platform-browser": "^11.2.3", - "@angular/platform-browser-dynamic": "^11.2.3", - "@angular/router": "^11.2.3", + "@angular/animations": "^11.2.6", + "@angular/cdk": "^11.2.5", + "@angular/cli": "^11.2.5", + "@angular/common": "^11.2.6", + "@angular/compiler": "^11.2.6", + "@angular/compiler-cli": "^11.2.6", + "@angular/core": "^11.2.6", + "@angular/forms": "^11.2.6", + "@angular/language-service": "^11.2.6", + "@angular/material": "^11.2.5", + "@angular/platform-browser": "^11.2.6", + "@angular/platform-browser-dynamic": "^11.2.6", + "@angular/router": "^11.2.6", "@biesbjerg/ngx-translate-extract": "^6.0.3", - "@fortawesome/fontawesome-free": "^5.15.2", - "@ionic/angular": "^5.5.5", + "@fortawesome/fontawesome-free": "^5.15.3", + "@ionic/angular": "^5.6.1", "@ngrx/store": "^9.2.1", "@ngrx/store-devtools": "^9.2.1", "@ngx-translate/core": "^12.1.2", "@ngx-translate/http-loader": "^4.0.0", "@peculiar/fortify-webcomponents": "^0.16.3", "@types/hammerjs": "^2.0.39", - "@types/jasmine": "^3.6.4", + "@types/jasmine": "^3.6.7", "@types/jasminewd2": "^2.0.8", "@types/jquery": "^3.5.5", - "@types/node": "^13.13.45", + "@types/node": "^13.13.47", "angular2-draggable": "^2.3.2", "angular2-signaturepad": "^3.0.4", "codelyzer": "^5.1.2", diff --git a/src/app/user/controllers/UserController.php b/src/app/user/controllers/UserController.php index f60ec2beda759f88d82fe79b1b3f7e5b07b7e426..07dcd40865fa3b136e4554f957d63c854931aeb3 100755 --- a/src/app/user/controllers/UserController.php +++ b/src/app/user/controllers/UserController.php @@ -113,13 +113,13 @@ class UserController if (empty($body)) { return $response->withStatus(400)->withJson(['errors' => 'Body is not set or empty']); - } elseif (!Validator::stringType()->notEmpty()->validate($body['login']) || !preg_match("/^[\w.@-]*$/", $body['login'])) { + } elseif (!Validator::stringType()->notEmpty()->length(1, 128)->validate($body['login']) || !preg_match("/^[\w.@-]*$/", $body['login'])) { return $response->withStatus(400)->withJson(['errors' => 'Body login is empty, not a string or wrong formatted']); - } elseif (!Validator::stringType()->notEmpty()->validate($body['firstname'])) { + } elseif (!Validator::stringType()->notEmpty()->length(1, 128)->validate($body['firstname'])) { return $response->withStatus(400)->withJson(['errors' => 'Body firstname is empty or not a string']); - } elseif (!Validator::stringType()->notEmpty()->validate($body['lastname'])) { + } elseif (!Validator::stringType()->notEmpty()->length(1, 128)->validate($body['lastname'])) { return $response->withStatus(400)->withJson(['errors' => 'Body lastname is empty or not a string']); - } elseif (empty($body['email']) || !filter_var($body['email'], FILTER_VALIDATE_EMAIL)) { + } elseif (empty($body['email']) || !filter_var($body['email'], FILTER_VALIDATE_EMAIL) || !Validator::stringType()->notEmpty()->length(1, 128)->validate($body['email'])) { return $response->withStatus(400)->withJson(['errors' => 'Body email is empty or not a valid email']); } @@ -181,11 +181,11 @@ class UserController if (!Validator::intVal()->notEmpty()->validate($args['id'])) { return $response->withStatus(400)->withJson(['errors' => 'Route id is not an integer']); - } elseif (!Validator::stringType()->notEmpty()->validate($body['firstname'])) { + } elseif (!Validator::stringType()->notEmpty()->length(1, 128)->validate($body['firstname'])) { return $response->withStatus(400)->withJson(['errors' => 'Body firstname is empty or not a string']); - } elseif (!Validator::stringType()->notEmpty()->validate($body['lastname'])) { + } elseif (!Validator::stringType()->notEmpty()->length(1, 128)->validate($body['lastname'])) { return $response->withStatus(400)->withJson(['errors' => 'Body lastname is empty or not a string']); - } elseif (empty($body['email']) || !filter_var($body['email'], FILTER_VALIDATE_EMAIL)) { + } elseif (empty($body['email']) || !filter_var($body['email'], FILTER_VALIDATE_EMAIL) || !Validator::stringType()->notEmpty()->length(1, 128)->validate($body['email'])) { return $response->withStatus(400)->withJson(['errors' => 'Body email is empty or not a valid email']); }