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
9e139990
Commit
9e139990
authored
5 months ago
by
David Siegfried
Committed by
Jan-Hendrik Willms
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fixes add files via url, fixes #4644
Closes #4644 Merge request
studip/studip!3456
parent
5365d284
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/filesystem/URLFile.php
+6
-6
6 additions, 6 deletions
lib/filesystem/URLFile.php
with
6 additions
and
6 deletions
lib/filesystem/URLFile.php
+
6
−
6
View file @
9e139990
...
...
@@ -15,14 +15,14 @@ class URLFile extends StandardFile
$file
=
new
File
();
$file
[
'name'
]
=
$data
[
'name'
]
?:
(
$meta
[
'filename'
]
?:
'unknown'
);
$file
[
'size'
]
=
$meta
[
'Content-Length'
]
?
:
'0'
;
$file
[
'mime_type'
]
=
$meta
[
'Content-Type'
]
?
mb_strstr
(
$meta
[
'Content-Type'
],
';'
,
true
)
:
get_mime_type
(
$file
[
'name'
]);
$file
[
'size'
]
=
$meta
[
'Content-Length'
]
?
?
'0'
;
$file
[
'mime_type'
]
=
!
empty
(
$meta
[
'Content-Type'
]
)
?
mb_strstr
(
$meta
[
'Content-Type'
],
';'
,
true
)
:
get_mime_type
(
$file
[
'name'
]);
$file
[
'metadata'
]
=
[
'url'
=>
$data
[
'url'
],
'access_type'
=>
$data
[
'access_type'
]
?
:
"redirect"
'access_type'
=>
$data
[
'access_type'
]
?
?
"redirect"
];
$file
[
'user_id'
]
=
$user_id
;
$file
[
'author_name'
]
=
$data
[
'author_name'
]
?
:
get_fullname
(
$file
[
'user_id'
]);
$file
[
'author_name'
]
=
$data
[
'author_name'
]
?
?
get_fullname
(
$file
[
'user_id'
]);
$file
[
'filetype'
]
=
get_called_class
();
$file
->
store
();
...
...
@@ -30,8 +30,8 @@ class URLFile extends StandardFile
$fileref
[
'file_id'
]
=
$file
->
getId
();
$fileref
[
'name'
]
=
$file
[
'name'
];
$fileref
[
'downloads'
]
=
0
;
$fileref
[
'description'
]
=
$data
[
'description'
]
?
:
""
;
$fileref
[
'content_terms_of_use_id'
]
=
$data
[
'content_terms_of_use_id'
]
?
:
ContentTermsOfUse
::
findDefault
()
->
id
;
$fileref
[
'description'
]
=
$data
[
'description'
]
?
?
''
;
$fileref
[
'content_terms_of_use_id'
]
=
$data
[
'content_terms_of_use_id'
]
?
?
ContentTermsOfUse
::
findDefault
()
->
id
;
$fileref
[
'user_id'
]
=
$user_id
;
return
new
static
(
$fileref
);
...
...
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