Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
optimus
api
Commits
6d10d309
Commit
6d10d309
authored
Dec 01, 2020
by
Lionel VEST
Browse files
*
parent
135b8b99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
resources/files.php
resources/files.php
+2
-2
No files found.
resources/files.php
View file @
6d10d309
...
...
@@ -14,10 +14,10 @@ function read($connection,$input)
}
else
if
(
$input
->
body
->
action
==
'convert_to_zip'
)
{
$path
=
'/srv/files/'
.
$input
->
db
.
str_replace
(
'/files/'
.
$input
->
db
,
''
,
$input
->
body
->
path
);
if
(
!
isset
(
$input
->
body
->
path
))
return
array
(
"code"
=>
400
,
"message"
=>
"Aucun chemin n'a été spécifié"
);
$path
=
'/srv/files/'
.
$input
->
db
.
str_replace
(
'/files/'
.
$input
->
db
,
''
,
$input
->
body
->
path
);
if
(
strpos
(
$input
->
body
->
path
,
'/..'
))
return
array
(
"code"
=>
400
,
"message"
=>
"Le chemin fourni est invalide"
);
if
(
!
isdir
(
$path
))
return
array
(
"code"
=>
400
,
"message"
=>
"Le chemin spécifié n'existe pas"
);
if
(
!
is
_
dir
(
$path
))
return
array
(
"code"
=>
400
,
"message"
=>
"Le chemin spécifié n'existe pas"
);
if
(
!
isset
(
$input
->
body
->
items
))
return
array
(
"code"
=>
400
,
"message"
=>
"Aucun fichier ou dossier à compresser n'a été spécifié"
);
foreach
(
$input
->
body
->
items
as
$item
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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