Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
maarchRM
Commits
a1e10b9b
Verified
Commit
a1e10b9b
authored
Mar 05, 2020
by
Alexandre Morin
Browse files
fix (13451) : unzip filename after validate digital resource
parent
2abaaea8
Pipeline
#7200
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bundle/recordsManagement/Controller/archiveValidationTrait.php
View file @
a1e10b9b
...
...
@@ -403,6 +403,7 @@ trait archiveValidationTrait
$digitalResource
->
size
=
filesize
(
$filename
);
if
(
$digitalResource
->
size
==
0
)
{
unlink
(
$filename
);
throw
new
\
bundle\recordsManagement\Exception\invalidArchiveException
(
'Resource size is null'
,
400
);
}
...
...
@@ -425,8 +426,10 @@ trait archiveValidationTrait
if
(
$formatValidation
)
{
$validation
=
$this
->
formatController
->
validateFormat
(
$filename
);
if
(
!
$validation
!==
true
&&
is_array
(
$validation
))
{
unlink
(
$filename
);
throw
new
\
core\Exception\BadRequestException
(
"Invalid format attachments for %s"
,
404
,
null
,
[
$digitalResource
->
fileName
]);
}
}
unlink
(
$filename
);
}
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment