Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchParapheur
Commits
e9e8290a
Commit
e9e8290a
authored
3 years ago
by
Quentin Ribac
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #18091 TIME 0:55 added isset() checks on array entries
parent
289dc67e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/user/controllers/UserController.php
+3
-3
3 additions, 3 deletions
src/app/user/controllers/UserController.php
with
3 additions
and
3 deletions
src/app/user/controllers/UserController.php
+
3
−
3
View file @
e9e8290a
...
...
@@ -479,11 +479,11 @@ class UserController
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
'Body writingColor is empty or not a string'
]);
}
elseif
(
!
Validator
::
arrayType
()
->
notEmpty
()
->
validate
(
$body
[
'notifications'
]))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
'Body notifications is empty or not an array'
]);
}
elseif
(
!
Validator
::
boolType
()
->
validate
(
$body
[
'notifications'
][
'instant'
]))
{
}
elseif
(
!
isset
(
$body
[
'notifications'
][
'instant'
])
||
!
Validator
::
boolType
()
->
validate
(
$body
[
'notifications'
][
'instant'
]))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
'Body notifications.instant is not a boolean'
]);
}
elseif
(
!
Validator
::
arrayType
()
->
each
(
Validator
::
in
(
$notificationsIds
))
->
validate
(
$body
[
'notifications'
][
'summaries'
]))
{
}
elseif
(
!
isset
(
$body
[
'notifications'
][
'summaries'
])
||
!
Validator
::
arrayType
()
->
each
(
Validator
::
in
(
$notificationsIds
))
->
validate
(
$body
[
'notifications'
][
'summaries'
]))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
'Body notifications.summaries is not an array or contains invalid IDs'
]);
}
elseif
(
!
Validator
::
oneOf
(
Validator
::
falseVal
(),
Validator
::
intVal
()
->
between
(
10
,
50
))
->
validate
(
$body
[
'signatureScaling'
]))
{
}
elseif
(
!
isset
(
$body
[
'signatureScaling'
])
||
!
Validator
::
oneOf
(
Validator
::
falseVal
(),
Validator
::
intVal
()
->
between
(
10
,
50
))
->
validate
(
$body
[
'signatureScaling'
]))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
'Body signatureScaling is neither false nor an integer between 10 and 50'
]);
}
...
...
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