Skip to content

Commit

Permalink
assert file extension validity first (Alfresco#1025)
Browse files Browse the repository at this point in the history
  • Loading branch information
pionnegru authored and dhrn committed Apr 30, 2019
1 parent aae3032 commit b6041da
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions projects/adf-office-services-ext/src/lib/evaluators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export function canOpenWithOffice(
return false;
}

const extension = getFileExtension(file.entry.name);
if (!extension || !supportedExtensions[extension]) {
return false;
}

// workaround for Shared files
if (
context.navigation &&
Expand All @@ -51,11 +56,6 @@ export function canOpenWithOffice(
return false;
}

const extension = getFileExtension(file.entry.name);
if (!extension || !supportedExtensions[extension]) {
return false;
}

/*
if (file.entry && file.entry.aspectNames) {
const checkedOut = file.entry.aspectNames.find(
Expand Down

0 comments on commit b6041da

Please sign in to comment.