Skip to content

Commit

Permalink
Merge pull request #2419 from nextcloud/backport/2418/stable29
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Aug 22, 2024
2 parents a46f5a3 + a401c81 commit 6658df8
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 @@ -23140,6 +23140,9 @@ function getDavPath({ filename, basename: basename3, source = "" }) {
);
}
const prefixUser = getUserRoot();
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 @@ -132,6 +132,10 @@ function getDavPath({ filename, basename, source = '' }: { filename: string, bas

const prefixUser = getUserRoot()

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 6658df8

Please sign in to comment.