Skip to content

Commit

Permalink
Merge pull request #2418 from nextcloud/fix/filename-requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Aug 13, 2024
2 parents ca91f53 + bf06f3f commit c6d57a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions js/viewer-main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26978,6 +26978,9 @@ const genFileInfo = function(obj) {
};
function getDavPath({ filename, source = "" }) {
const prefixUser = davRootPath;
if (!filename || typeof filename !== "string") {
return null;
}
if (source && !source.includes(prefixUser)) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion js/viewer-main.mjs.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/utils/fileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ function getDavPath({ filename, source = '' }: { filename: string, source?: stri
// https://github.com/nextcloud/server/issues/19700
const prefixUser = davRootPath

if (!filename || typeof filename !== 'string') {
return null
}

// If we have a source but we're not a dav resource, return null
if (source && !source.includes(prefixUser)) {
return null
Expand Down

0 comments on commit c6d57a2

Please sign in to comment.