Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
caseine
moodle-mod_vpl
Commits
70325081
Commit
70325081
authored
Mar 11, 2021
by
Astor Bizard
Browse files
Fixed subdirectories on archive submission.
parent
7cd51c5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
forms/submission.php
View file @
70325081
...
@@ -91,6 +91,9 @@ if ($fromform = $mform->get_data()) {
...
@@ -91,6 +91,9 @@ if ($fromform = $mform->get_data()) {
// Read archive and split between required / additional files.
// Read archive and split between required / additional files.
for
(
$i
=
0
;
$i
<
$zip
->
numFiles
;
$i
++
)
{
for
(
$i
=
0
;
$i
<
$zip
->
numFiles
;
$i
++
)
{
$filename
=
$zip
->
statIndex
(
$i
)[
'name'
];
$filename
=
$zip
->
statIndex
(
$i
)[
'name'
];
if
(
substr
(
$filename
,
-
1
)
==
'/'
)
{
// Directory.
continue
;
}
$filecontent
=
file_get_contents
(
'zip://'
.
$zipname
.
'#'
.
$filename
);
$filecontent
=
file_get_contents
(
'zip://'
.
$zipname
.
'#'
.
$filename
);
// Autodetect text file encode if not binary.
// Autodetect text file encode if not binary.
if
(
!
vpl_is_binary
(
$filename
))
{
if
(
!
vpl_is_binary
(
$filename
))
{
...
...
Write
Preview
Supports
Markdown
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