Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty extension of Google drive file should not cause dot to be appended to file name #37060

Merged
merged 1 commit into from
Mar 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/files_external/lib/Lib/Storage/Google.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ public function opendir($path) {
if ($child->getMimeType() === self::MAP) {
continue; // No method known to transfer map files, ignore it
} elseif ($child->getMimeType() !== self::FOLDER) {
$name .= '.'.$this->getGoogleDocExtension($child->getMimeType());
$extension = $this->getGoogleDocExtension($child->getMimeType());
// don't append an empty extension as they will create broken paths
if ($extension !== '') {
$name .= ".{$extension}";
}
}
}
if ($path === '') {
Expand Down
7 changes: 7 additions & 0 deletions changelog/unreleased/37044
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: Google drive files without extension 404

Google Drive files without a file extension (".git/HEAD" for example) would result in a 404 response from the Web UI or desktop client.
The problem has been fixed.

https://github.com/owncloud/core/issues/37044
https://github.com/owncloud/core/pull/37045