diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-09-30 10:15:54 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-09-30 10:15:54 +0000 |
| commit | 8e9222919fa9cc06dcfbbeb10e12667c6bd95b26 (patch) | |
| tree | 74354ce945c00d09a56f90c61188d1d8c180276b /lib/filesystem/URLFile.php | |
| parent | b4b0e9687ec5e9dd5eb6eeb629e6486c8efb8744 (diff) | |
prevent many warnings regarding php8 on main, fixes #4631
Closes #4631
Merge request studip/studip!3448
Diffstat (limited to 'lib/filesystem/URLFile.php')
| -rw-r--r-- | lib/filesystem/URLFile.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/filesystem/URLFile.php b/lib/filesystem/URLFile.php index 39de08b..3a5b15c 100644 --- a/lib/filesystem/URLFile.php +++ b/lib/filesystem/URLFile.php @@ -22,7 +22,7 @@ class URLFile extends StandardFile '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'] = trim($data['author_name'] ?? '') ?: get_fullname($file['user_id']); $file['filetype'] = get_called_class(); $file->store(); @@ -30,7 +30,7 @@ class URLFile extends StandardFile $fileref['file_id'] = $file->getId(); $fileref['name'] = $file['name']; $fileref['downloads'] = 0; - $fileref['description'] = $data['description'] ?? ''; + $fileref['description'] = trim($data['description'] ?? ''); $fileref['content_terms_of_use_id'] = $data['content_terms_of_use_id'] ?? ContentTermsOfUse::findDefault()->id; $fileref['user_id'] = $user_id; |
