Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
4a75df56
Commit
4a75df56
authored
1 year ago
by
André Noack
Committed by
Jan-Hendrik Willms
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Resolve ""Falsche" Verzeichnisstruktur bei Download aus Veranstaltung"
Closes #928 Merge request
studip/studip!2490
parent
cf09538d
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
lib/filesystem/FileArchiveManager.class.php
+6
-6
6 additions, 6 deletions
lib/filesystem/FileArchiveManager.class.php
with
6 additions
and
6 deletions
lib/filesystem/FileArchiveManager.class.php
+
6
−
6
View file @
4a75df56
...
...
@@ -104,7 +104,7 @@ class FileArchiveManager
//The URL has been fetched and we can put it
//in a file in the archive:
$archive
->
addFromString
(
$archive_fs_path
.
$file_type
->
getFilename
()
.
'.url'
,
$archive_fs_path
.
FileManager
::
cleanFileName
(
$file_type
->
getFilename
()
)
.
'.url'
,
"[InternetShortcut]
\n
URL=
{
$url
}
\n
"
);
//Check the file size of the archive:
...
...
@@ -119,7 +119,7 @@ class FileArchiveManager
if
(
is_array
(
$file_list
))
{
$user
=
$file_type
->
getUser
();
$file_list
[]
=
[
'name'
=>
$file_type
->
getFilename
(),
'name'
=>
FileManager
::
cleanFileName
(
$file_type
->
getFilename
()
)
,
'size'
=>
$file_type
->
getSize
(),
'first_name'
=>
(
$user
instanceof
User
)
?
$user
->
vorname
:
''
,
'last_name'
=>
(
$user
instanceof
User
)
?
$user
->
nachname
:
''
,
...
...
@@ -144,7 +144,7 @@ class FileArchiveManager
if
(
$path
)
{
//It is a file in the file system:
if
(
file_exists
(
$path
))
{
$archive
->
addFile
(
$path
,
$archive_fs_path
.
$file_type
->
getFilename
());
$archive
->
addFile
(
$path
,
$archive_fs_path
.
FileManager
::
cleanFileName
(
$file_type
->
getFilename
())
)
;
//Check the file size of the archive:
if
(
file_exists
(
$archive
->
filename
)
&&
filesize
(
$archive
->
filename
)
>
$archive_max_size
)
{
throw
new
FileArchiveManagerException
(
...
...
@@ -160,13 +160,13 @@ class FileArchiveManager
$archive_max_size
=
Config
::
get
()
->
ZIP_DOWNLOAD_MAX_SIZE
*
1024
*
1024
;
//1048576 bytes = 1 Mebibyte
$user
=
$file_type
->
getUser
();
$file_list
[]
=
[
'name'
=>
$file_type
->
getFilename
(),
'name'
=>
FileManager
::
cleanFileName
(
$file_type
->
getFilename
()
)
,
'size'
=>
$file_type
->
getSize
(),
'first_name'
=>
(
$user
instanceof
User
)
?
$user
->
vorname
:
''
,
'last_name'
=>
(
$user
instanceof
User
)
?
$user
->
nachname
:
''
,
'downloads'
=>
$file_type
->
getDownloads
(),
'mkdate'
=>
date
(
'd.m.Y H:i'
,
$file_type
->
getMakeDate
()),
'path'
=>
(
$archive_fs_path
.
$file_type
->
getFilename
())
'path'
=>
(
$archive_fs_path
.
FileManager
::
cleanFileName
(
$file_type
->
getFilename
())
)
];
if
(
count
(
$file_list
)
>
$archive_max_num_files
)
{
$archive
->
unchangeAll
();
...
...
@@ -283,7 +283,7 @@ class FileArchiveManager
$folder_zip_path
=
$archive_fs_path
;
if
(
$keep_hierarchy
)
{
$folder_zip_path
.
=
$folder
->
name
;
$folder_zip_path
.
=
FileManager
::
cleanFileName
(
$folder
->
name
)
;
$archive
->
addEmptyDir
(
$folder_zip_path
);
}
foreach
(
$folder
->
getFiles
()
as
$file
)
{
...
...
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